Class ProportionalTimeEstimatorImpl

  • All Implemented Interfaces:
    TimeEstimator

    public class ProportionalTimeEstimatorImpl
    extends java.lang.Object
    implements TimeEstimator
    Class implementing the 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.
    Since:
    5.0
    • Constructor Summary

      Constructors 
      Constructor Description
      ProportionalTimeEstimatorImpl​(long imageContainerSize)
      Creates a new object of this class with a defined internal buffer size.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getUploadTimeLeft()
      Return the estimated time left in milliseconds based on the calls to start and stop methods.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProportionalTimeEstimatorImpl

        public ProportionalTimeEstimatorImpl​(long imageContainerSize)
        Creates a new object of this class with a defined internal buffer size.
        Parameters:
        imageContainerSize - The total size in bytes of the data container for which upload time is being estimated.
    • Method Detail

      • stop

        public void stop​(long uploadedBytes)
        Description copied from interface: TimeEstimator
        Stops the time counting and updates the internal updates the internal time counter and counter of total number of transmitted bytes.
        Specified by:
        stop in interface TimeEstimator
        Parameters:
        uploadedBytes - Number of bytes uploaded in a single time frame that is being sampled.
        See Also:
        TimeEstimator.stop(long)