Class ExponentialWeightedAverageStatistic

  • All Implemented Interfaces:
    BandwidthStatistic

    @Deprecated
    public class ExponentialWeightedAverageStatistic
    extends Object
    implements BandwidthStatistic
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    A BandwidthStatistic that calculates estimates using an exponential weighted average.
    • Field Detail

      • DEFAULT_SMOOTHING_FACTOR

        public static final double DEFAULT_SMOOTHING_FACTOR
        Deprecated.
        The default smoothing factor.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ExponentialWeightedAverageStatistic

        public ExponentialWeightedAverageStatistic()
        Deprecated.
        Creates an instance with DEFAULT_SMOOTHING_FACTOR.
      • ExponentialWeightedAverageStatistic

        public ExponentialWeightedAverageStatistic​(double smoothingFactor)
        Deprecated.
        Creates an instance.
        Parameters:
        smoothingFactor - The exponential smoothing factor.
    • Method Detail

      • addSample

        public void addSample​(long bytes,
                              long durationUs)
        Deprecated.
        Description copied from interface: BandwidthStatistic
        Adds a transfer sample to the statistic.
        Specified by:
        addSample in interface BandwidthStatistic
        Parameters:
        bytes - The number of bytes transferred.
        durationUs - The duration of the transfer, in microseconds.
      • reset

        public void reset()
        Deprecated.
        Description copied from interface: BandwidthStatistic
        Resets the statistic. The statistic should drop all samples and reset to its initial state, similar to right after construction.
        Specified by:
        reset in interface BandwidthStatistic