net.i2p.router.peermanager
Class SpeedCalculator
java.lang.Object
net.i2p.router.peermanager.Calculator
net.i2p.router.peermanager.SpeedCalculator
public class SpeedCalculator
- extends Calculator
Quantify how fast the peer is - how fast they respond to our requests, how fast
they pass messages on, etc. This should be affected both by their bandwidth/latency,
as well as their load. The essence of the current algorithm is to determine
approximately how many 2KB messages the peer can pass round trip within a single
minute - not based just on itself though, but including the delays of other peers
in the tunnels. As such, more events make it more accurate.
Method Summary |
double |
calc(PeerProfile profile)
Evaluate the profile according to the current metric |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PROP_EVENT_THRESHOLD
public static final java.lang.String PROP_EVENT_THRESHOLD
- minimum number of events to use a particular period's data. If this many
events haven't occurred in the period yet, the next largest period is tried.
- See Also:
- Constant Field Values
DEFAULT_EVENT_THRESHOLD
public static final int DEFAULT_EVENT_THRESHOLD
- See Also:
- Constant Field Values
PROP_USE_INSTANTANEOUS_RATES
public static final java.lang.String PROP_USE_INSTANTANEOUS_RATES
- should the calculator use instantaneous rates, or period averages?
- See Also:
- Constant Field Values
DEFAULT_USE_INSTANTANEOUS_RATES
public static final boolean DEFAULT_USE_INSTANTANEOUS_RATES
- See Also:
- Constant Field Values
PROP_USE_TUNNEL_TEST_ONLY
public static final java.lang.String PROP_USE_TUNNEL_TEST_ONLY
- should the calculator use tunnel test time only, or include all data?
- See Also:
- Constant Field Values
DEFAULT_USE_TUNNEL_TEST_ONLY
public static final boolean DEFAULT_USE_TUNNEL_TEST_ONLY
- See Also:
- Constant Field Values
SpeedCalculator
public SpeedCalculator(RouterContext context)
calc
public double calc(PeerProfile profile)
- Description copied from class:
Calculator
- Evaluate the profile according to the current metric
- Overrides:
calc
in class Calculator