SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunction


public interface SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunction


An interface to decide if samples need to be evicted from the estimator.

Summary

Public methods

abstract boolean

Whether the sample at the front of the queue needs to be evicted.

Public methods

shouldEvictSample

abstract boolean shouldEvictSample(
    Deque<SlidingWeightedAverageBandwidthStatistic.Sample> samples
)

Whether the sample at the front of the queue needs to be evicted. Called before adding a next sample.

Parameters
Deque<SlidingWeightedAverageBandwidthStatistic.Sample> samples

A queue of samples, ordered by timeAddedMs. The oldest sample is at front of the queue. The queue must not be modified.