public class DefaultBandwidthMeter extends java.lang.Object implements BandwidthMeter
| Modifier and Type | Field and Description |
|---|---|
static float |
DEFAULT_BITRATE_ESTIMATE
Default percentile for the bitrate estimate.
|
static long |
DEFAULT_INITIAL_BITRATE_ESTIMATE
Default initial bitrate estimate used when the device is offline or the network type cannot be
determined, in bits per second.
|
static int |
DEFAULT_SLIDING_WINDOW_MAX_WEIGHT
Default maximum weight for the sliding window.
|
static float |
DEFAULT_SLIDING_WINDOW_PERCENTILE
Default percentile for the sliding window.
|
| Constructor and Description |
|---|
DefaultBandwidthMeter() |
DefaultBandwidthMeter(long bitrate,
int maxWeight,
float slidingPercentile,
float bitratePercentile) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSample(long sampleBytesTransferred,
long sampleElapsedTimeMs) |
long |
getBitrateEstimate() |
public static final long DEFAULT_INITIAL_BITRATE_ESTIMATE
public static final int DEFAULT_SLIDING_WINDOW_MAX_WEIGHT
public static final float DEFAULT_SLIDING_WINDOW_PERCENTILE
public static final float DEFAULT_BITRATE_ESTIMATE
public DefaultBandwidthMeter()
public DefaultBandwidthMeter(long bitrate,
int maxWeight,
float slidingPercentile,
float bitratePercentile)
public long getBitrateEstimate()
getBitrateEstimate in interface BandwidthMeterpublic void addSample(long sampleBytesTransferred,
long sampleElapsedTimeMs)
addSample in interface BandwidthMeter