class SimpleBandwidthEstimator extends Object implements BandwidthEstimator
| Constructor and Description |
|---|
SimpleBandwidthEstimator(I2PAppContext ctx,
PeerState state)
Creates a new bandwidth estimator for the given peer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSample(int acked)
Records a new bandwidth sample based on the number of bytes acknowledged.
|
float |
getBandwidthEstimate()
Returns the current bandwidth estimate in bytes per millisecond.
|
float |
getBandwidthEstimate(long now)
Returns the current bandwidth estimate at the specified time.
|
String |
toString()
Returns a string representation of this estimator's current state.
|
SimpleBandwidthEstimator(I2PAppContext ctx, PeerState state)
ctx - I2P application contextstate - peer state for RTT and other transport metricspublic void addSample(int acked)
addSample in interface BandwidthEstimatoracked - number of bytes newly acknowledgedpublic float getBandwidthEstimate()
getBandwidthEstimate in interface BandwidthEstimatorpublic float getBandwidthEstimate(long now)
now - current time in milliseconds