public class ProportionalTimeEstimatorImpl extends Object implements TimeEstimator
TimeEstimator
interface. Uses the Exponential
Moving Average equation to provide an estimate of the remaining upload time
of binary data. A correction factor is used for minimal overestimation.Constructor and Description |
---|
ProportionalTimeEstimatorImpl(long imageContainerSize)
Creates a new object of this class with a defined internal buffer size.
|
Modifier and Type | Method and Description |
---|---|
long |
getUploadTimeLeft()
|
void |
start()
Starts the time counting.
|
void |
stop()
Stops the time counting and updates the internal time counter.
|
void |
stop(long uploadedBytes)
Stops the time counting and updates the internal updates the internal
time counter and counter of total number of transmitted bytes.
|
public ProportionalTimeEstimatorImpl(long imageContainerSize)
imageContainerSize
- The total size in bytes of the data container for which upload
time is being estimated.public void start()
TimeEstimator
start
in interface TimeEstimator
TimeEstimator.start()
public void stop()
TimeEstimator
stop
in interface TimeEstimator
TimeEstimator.stop()
public void stop(long uploadedBytes)
TimeEstimator
stop
in interface TimeEstimator
uploadedBytes
- Number of bytes uploaded in a single time frame that is being
sampled.TimeEstimator.stop(long)
public long getUploadTimeLeft()
TimeEstimator
getUploadTimeLeft
in interface TimeEstimator
stop
hasn't been called at least
once before calling this method.TimeEstimator.getUploadTimeLeft()
Version: 5.3.3-ice35-b63
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.