public class TunnelHistory extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static long[] | RATESRate periods for history tracking |
static int | TUNNEL_REJECT_BANDWIDTHTunnel rejection due to excess bandwidth usage - used for most rejections even if not really for bandwidth |
static int | TUNNEL_REJECT_CRITTunnel rejection due to system failure - not currently used |
static int | TUNNEL_REJECT_PROBABALISTIC_REJECTProbabalistic tunnel rejection due to a flood of requests - infrequent |
static int | TUNNEL_REJECT_STREAMING_NACKStreaming NACK - peer accepted tunnel but can't deliver data |
static int | TUNNEL_REJECT_TRANSIENT_OVERLOADTunnel rejection due to temporary cpu/job/tunnel overload - rare |
| Constructor and Description |
|---|
TunnelHistory(RouterContext context,
String statGroup)TunnelHistory. |
| Modifier and Type | Method and Description |
|---|---|
void | coalesceStats()Coalesce the rate statistics. |
double | getAcceptanceRatio()Calculate the ratio of accepted to rejected tunnel requests. |
RateStat | getFailedRate()Failure rate statistics for this peer. |
long | getLastAgreedTo()When the peer last agreed to participate in a tunnel |
long | getLastFailed()When the last tunnel the peer participated in failed |
long | getLastRejectedBandwidth()When the peer last refused to participate in a tunnel complaining of bandwidth overload |
long | getLastRejectedCritical()When the peer last refused to participate in a tunnel with level of critical |
long | getLastRejectedProbabalistic()When the peer last refused to participate in a tunnel probabalistically |
long | getLastRejectedTransient()When the peer last refused to participate in a tunnel complaining of transient overload |
long | getLastTestedSuccessfully()When the peer last passed a tunnel test |
long | getLifetimeAgreedTo()Total tunnels the peer has agreed to participate in |
long | getLifetimeFailed()Total tunnels the peer has agreed to participate in that were later marked as failed prematurely |
long | getLifetimeRejected()Total tunnels the peer has refused to participate in |
RateStat | getRejectionRate()Rejection rate statistics for this peer. |
void | incrementAgreedTo()Count a tunnel participation agreement and record its time. |
void | incrementFailed(int pct)Define this rate as the probability it really failed |
void | incrementProcessed(int processedSuccessfully,
int failedProcessing)Processed message counter; legacy method, no longer tracked. |
void | incrementRejected(int severity)Count a tunnel rejection at the given severity and record its time. |
void | incrementTestSucceeded()Record that a tunnel test through this peer succeeded. |
void | load(Properties props)Restore the tunnel history fields from the given properties. |
void | store(OutputStream out)Write the tunnel history to the stream, including comments. |
void | store(OutputStream out,
boolean addComments)Write the data from the profile to the stream |
static final long[] RATES
public static final int TUNNEL_REJECT_BANDWIDTH
public static final int TUNNEL_REJECT_CRIT
public static final int TUNNEL_REJECT_PROBABALISTIC_REJECT
public static final int TUNNEL_REJECT_STREAMING_NACK
public static final int TUNNEL_REJECT_TRANSIENT_OVERLOAD
public TunnelHistory(RouterContext context, String statGroup)
public void coalesceStats()
public double getAcceptanceRatio()
public RateStat getFailedRate()
public long getLastAgreedTo()
public long getLastFailed()
public long getLastRejectedBandwidth()
public long getLastRejectedCritical()
public long getLastRejectedProbabalistic()
public long getLastRejectedTransient()
public long getLastTestedSuccessfully()
public long getLifetimeAgreedTo()
public long getLifetimeFailed()
public long getLifetimeRejected()
public RateStat getRejectionRate()
public void incrementAgreedTo()
public void incrementFailed(int pct)
pct - = probability * 100public void incrementProcessed(int processedSuccessfully,
int failedProcessing)public void incrementRejected(int severity)
severity - how much the peer doesnt want to participate in the
tunnel (large == more severe)public void incrementTestSucceeded()
public void load(Properties props)
public void store(OutputStream out) throws IOException
IOExceptionpublic void store(OutputStream out, boolean addComments) throws IOException
addComments - add comment lines to the outputIOException