class SimpleBandwidthEstimator extends Object implements BandwidthEstimator
| Constructor and Description |
|---|
SimpleBandwidthEstimator(I2PAppContext ctx,
ConnectionOptions opts)New estimator bound to the given options. |
| Modifier and Type | Method and Description |
|---|---|
void | addSample(int acked)Records an arriving ack. |
float | getBandwidthEstimate()Current bandwidth estimate. |
static int | getDecayFactor()Returns the current EWMA decay factor. |
static void | setDecayFactor(int factor)EWMA decay factor for new estimators. |
String | toString()Debug representation of the estimate state. |
SimpleBandwidthEstimator(I2PAppContext ctx, ConnectionOptions opts)
public void addSample(int acked)
addSample in interface BandwidthEstimatoracked - how many packets were acked with this ackpublic float getBandwidthEstimate()
getBandwidthEstimate in interface BandwidthEstimatorpublic static int getDecayFactor()
public static void setDecayFactor(int factor)
factor - the new decay factor (clamped to 2..16)