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