public class NodeStats extends java.lang.Object implements Persistable, BlockTransmitter.BlockTimeCallback
Modifier and Type | Class and Description |
---|---|
class |
NodeStats.PeerLoadStats
Stats to send to a single peer so it can determine whether we are likely to reject
a request.
|
static class |
NodeStats.RequestType |
static class |
NodeStats.TimedStats |
Modifier and Type | Method and Description |
---|---|
void |
blockTime(long interval,
boolean realtime) |
int |
calculateMaxTransfersOut(PeerNode peer,
boolean realTime,
double nonOverheadFraction,
int maxTransfersOutUpperLimit) |
StoreLocationStats |
chkCacheStats()
View of stats for CHK Cache
|
StoreLocationStats |
chkClientCacheStats()
View of stats for CHK ClientCache
|
StoreLocationStats |
chkSlashDotCacheStats()
View of stats for CHK SlashdotCache
|
StoreLocationStats |
chkStoreStats()
View of stats for CHK Store
|
NodeStats.PeerLoadStats |
createPeerLoadStats(PeerNode peer,
int transfersPerInsert,
boolean realTimeFlag) |
void |
drawNewLoadManagementDelayTimes(HTMLNode content) |
boolean |
enableNewLoadManagement(boolean realTimeFlag) |
void |
endAnnouncement(long uid) |
SimpleFieldSet |
exportVolatileFieldSet() |
void |
failedBlockReceive(boolean normalFetch,
boolean timeout,
boolean realTimeFlag,
boolean isLocal) |
void |
fillDetailedTimingsBox(HTMLNode html) |
void |
fillRemoteRequestHTLsBox(HTMLNode html,
boolean realTime) |
void |
fillSuccessRateBox(HTMLNode parent) |
int |
getActiveThreadCount() |
int[] |
getActiveThreadsByPriority() |
long |
getAllocationNoticesBytesSent() |
long |
getAnnounceBytesPayloadSent() |
long |
getAnnounceBytesSent() |
double |
getBandwidthLiabilityUsage() |
double |
getBwlimitDelayTime() |
double |
getBwlimitDelayTimeBulk() |
double |
getBwlimitDelayTimeRT() |
long |
getChangedIPBytesSent() |
long |
getCHKInsertTotalBytesSent() |
long |
getCHKRequestTotalBytesSent() |
int |
getDarknetSizeEstimate(long timestamp) |
NodeStats.TimedStats[] |
getDatabaseJobExecutionStatistics() |
long |
getDisconnBytesSent() |
long |
getFOAFBytesSent() |
int[] |
getIncomingRequestLocation(int[] retval) |
long |
getInitialMessagesBytesSent() |
java.lang.Object[] |
getKnownLocations(long timestamp) |
boolean |
getLocalRejectReasonsTable(HTMLNode table) |
double |
getLowerLimit(double upperLimit,
int peerCount) |
NodeStats.TimedStats[] |
getMandatoryBackoffStatistics(boolean realtime) |
long |
getNetworkColoringSentBytes() |
double |
getNodeAveragePingTime() |
long[] |
getNodeIOStats() |
long |
getNodeToNodeBytesSent() |
byte[] |
getNoisyRejectStats() |
long |
getNotificationOnlyPacketsSentBytes() |
long |
getOfferedKeysTotalBytesReceived() |
long |
getOfferedKeysTotalBytesSent() |
long |
getOffersSentBytesSent() |
int |
getOpennetSizeEstimate(long timestamp) |
int[] |
getOutgoingLocalRequestLocation(int[] retval) |
int[] |
getOutgoingRequestLocation(int[] retval) |
long |
getPingSentBytes() |
long |
getProbeRequestSentBytes() |
boolean |
getRejectReasonsTable(HTMLNode table) |
long |
getResendBytesSent() |
long |
getRoutedMessageSentBytes() |
NodeStats.TimedStats[] |
getRoutingBackoffStatistics(boolean realtime) |
long |
getRoutingStatusBytes() |
freenet.node.NodeStats.RunningRequestsSnapshot |
getRunningRequestsTo(PeerNode peerNode,
int transfersPerInsert,
boolean realTimeFlag) |
long |
getSentOverhead() |
double |
getSentOverheadPerSecond()
The average number of bytes sent per second for things other than requests, inserts,
and offer replies.
|
long |
getSSKInsertTotalBytesSent() |
long |
getSSKRequestTotalBytesSent() |
long |
getSwappingTotalBytesReceived() |
long |
getSwappingTotalBytesSent() |
int |
getThreadLimit() |
java.lang.Thread[] |
getThreads()
Gets a copy of the thread list.
|
long |
getTotalAuthBytesSent() |
NodeStats.TimedStats[] |
getTransferBackoffStatistics(boolean realtime) |
int |
getTransfersPerAnnounce() |
long |
getUOMBytesSent() |
int[] |
getWaitingThreadsByPriority() |
boolean |
ignoreLocalVsRemoteBandwidthLiability() |
void |
insertReceivedBytes(boolean ssk,
int x) |
void |
insertSentBytes(boolean ssk,
int x) |
boolean |
isTestnetEnabled() |
protected java.lang.String |
l10n(java.lang.String key) |
protected java.lang.String |
l10n(java.lang.String key,
java.lang.String[] patterns,
java.lang.String[] values) |
long |
maxPeerPingTime()
If a peer is over this threshold it is considered to be backed off.
|
void |
maybeUpdateNodeIOStats(long now)
Update the node-wide bandwidth I/O stats if the timer has expired
|
void |
maybeUpdatePeerManagerUserAlertStats(long now)
Update peerManagerUserAlertStats if the timer has expired.
|
void |
networkColoringReceivedBytes(int x) |
void |
networkColoringSentBytes(int x) |
void |
offeredKeysSenderReceivedBytes(int x) |
void |
offeredKeysSenderSentBytes(int x) |
int |
outwardTransfersPerInsert() |
NodeStats.PeerLoadStats |
parseLoadStats(PeerNode source,
Message m) |
SimpleFieldSet |
persistThrottlesToFieldSet() |
void |
pingCounterReceived(int x) |
void |
pingCounterSent(int x) |
double |
pRejectIncomingInstantly() |
double |
pRejectIncomingInstantlyCHKInsertBulk() |
double |
pRejectIncomingInstantlyCHKInsertRT() |
double |
pRejectIncomingInstantlyCHKRequestBulk() |
double |
pRejectIncomingInstantlyCHKRequestRT() |
double |
pRejectIncomingInstantlySSKInsertBulk() |
double |
pRejectIncomingInstantlySSKInsertRT() |
double |
pRejectIncomingInstantlySSKRequestBulk() |
double |
pRejectIncomingInstantlySSKRequestRT() |
double |
randomNoise(double input,
double sigma)
Applies multiplicative Gaussian noise of mean 1.0 and the specified sigma to the input value.
|
void |
reportAllocatedSlot(boolean local) |
void |
reportAnnounceForwarded(int forwardedRefs,
PeerNode source) |
void |
reportAuthBytes(int x) |
void |
reportCHKOutcome(long rtt,
boolean successful,
double location,
boolean isRealtime) |
void |
reportDatabaseJob(java.lang.String jobType,
long executionTimeMiliSeconds) |
void |
reportFatalTimeoutInWait(boolean local) |
void |
reportIncomingRequestLocation(double loc) |
void |
reportMandatoryBackoff(java.lang.String backoffType,
long backoffTimeMilliSeconds,
boolean realtime) |
void |
reportNLMDelay(long waitTime,
boolean realTime,
boolean local) |
void |
reportOutgoingLocalRequestLocation(double loc) |
void |
reportOutgoingRequestLocation(double loc) |
void |
reportRoutingBackoff(java.lang.String backoffType,
long backoffTimeMilliSeconds,
boolean realtime) |
void |
reportSSKOutcome(long rtt,
boolean successful,
boolean isRealtime) |
void |
reportTransferBackoff(java.lang.String backoffType,
long backoffTimeMilliSeconds,
boolean realtime) |
void |
reportUOMBytesSent(int x) |
void |
requestCompleted(boolean succeeded,
boolean isRemote,
boolean isSSK) |
void |
requestReceivedBytes(boolean ssk,
int x) |
void |
requestSentBytes(boolean ssk,
int x) |
freenet.node.NodeStats.AnnouncementDecision |
shouldAcceptAnnouncement(long uid) |
freenet.node.NodeStats.RejectReason |
shouldRejectRequest(boolean canAcceptAnyway,
boolean isInsert,
boolean isSSK,
boolean isLocal,
boolean isOfferReply,
PeerNode source,
boolean hasInStore,
boolean preferInsert,
boolean realTimeFlag,
UIDTag tag)
Should a request be accepted by this node, based on its local capacity?
This includes thread limits and ping times, but more importantly,
mechanisms based on predicting worst case bandwidth usage for all running
requests, and fairly sharing that capacity between peers.
|
StoreLocationStats |
sskCacheStats()
View of stats for SSK Cache
|
StoreLocationStats |
sskClientCacheStats()
View of stats for SSK ClientCache
|
StoreLocationStats |
sskSlashDotCacheStats()
View of stats for SSK SlashdotCache
|
StoreLocationStats |
sskStoreStats()
View of stats for SSK Store
|
void |
start() |
void |
successfulBlockReceive(boolean realTimeFlag,
boolean isLocal) |
void |
swappingReceivedBytes(int x) |
void |
swappingSentBytes(int x) |
void |
waitUntilNotOverloaded(boolean isInsert) |
public static final long DEFAULT_SUB_MAX_PING_TIME
public static final long DEFAULT_MAX_PING_TIME
public static final long MAX_THROTTLE_DELAY_RT
public static final long MAX_THROTTLE_DELAY_BULK
public static final long SUB_MAX_THROTTLE_DELAY_RT
public static final long SUB_MAX_THROTTLE_DELAY_BULK
public static final long MAX_BWLIMIT_DELAY_TIME_ALERT_THRESHOLD
public static final long MAX_NODE_AVERAGE_PING_TIME_ALERT_THRESHOLD
public static final long MAX_BWLIMIT_DELAY_TIME_ALERT_DELAY
public static final long MAX_NODE_AVERAGE_PING_TIME_ALERT_DELAY
public static final long MAX_INTERREQUEST_TIME
public final PeerManager peers
public boolean bwlimitDelayAlertRelevant
public boolean nodeAveragePingAlertRelevant
public final BootstrappingDecayingRunningAverage pInstantRejectIncomingOverall
public final BootstrappingDecayingRunningAverage pInstantRejectIncomingCHKRequestRT
public final BootstrappingDecayingRunningAverage pInstantRejectIncomingSSKRequestRT
public final BootstrappingDecayingRunningAverage pInstantRejectIncomingCHKInsertRT
public final BootstrappingDecayingRunningAverage pInstantRejectIncomingSSKInsertRT
public final BootstrappingDecayingRunningAverage pInstantRejectIncomingCHKRequestBulk
public final BootstrappingDecayingRunningAverage pInstantRejectIncomingSSKRequestBulk
public final BootstrappingDecayingRunningAverage pInstantRejectIncomingCHKInsertBulk
public final BootstrappingDecayingRunningAverage pInstantRejectIncomingSSKInsertBulk
public final Histogram2 chkSuccessRatesByLocation
public final RunningAverage routingMissDistanceLocal
public final RunningAverage routingMissDistanceRemote
public final RunningAverage routingMissDistanceOverall
public final RunningAverage routingMissDistanceBulk
public final RunningAverage routingMissDistanceRT
public final RunningAverage backedOffPercent
public final DecayingKeyspaceAverage avgCacheCHKLocation
public final DecayingKeyspaceAverage avgSlashdotCacheCHKLocation
public final DecayingKeyspaceAverage avgStoreCHKLocation
public final DecayingKeyspaceAverage avgStoreCHKSuccess
public double furthestCacheCHKSuccess
public double furthestClientCacheCHKSuccess
public double furthestSlashdotCacheCHKSuccess
public double furthestStoreCHKSuccess
public double furthestStoreSSKSuccess
public double furthestCacheSSKSuccess
public double furthestClientCacheSSKSuccess
public double furthestSlashdotCacheSSKSuccess
protected final freenet.node.Persister persister
protected final DecayingKeyspaceAverage avgRequestLocation
public final java.lang.ThreadGroup rootThreadGroup
public final DecayingKeyspaceAverage avgClientCacheCHKLocation
public final DecayingKeyspaceAverage avgCacheCHKSuccess
public final DecayingKeyspaceAverage avgSlashdotCacheCHKSucess
public final DecayingKeyspaceAverage avgClientCacheCHKSuccess
public final DecayingKeyspaceAverage avgStoreSSKLocation
public final DecayingKeyspaceAverage avgCacheSSKLocation
public final DecayingKeyspaceAverage avgSlashdotCacheSSKLocation
public final DecayingKeyspaceAverage avgClientCacheSSKLocation
public final DecayingKeyspaceAverage avgCacheSSKSuccess
public final DecayingKeyspaceAverage avgSlashdotCacheSSKSuccess
public final DecayingKeyspaceAverage avgClientCacheSSKSuccess
public final DecayingKeyspaceAverage avgStoreSSKSuccess
public final ByteCounter resendByteCounter
public final ByteCounter announceByteCounter
public ByteCounter sskRequestCtr
public ByteCounter chkRequestCtr
public ByteCounter sskInsertCtr
public ByteCounter chkInsertCtr
public ByteCounter probeRequestCtr
public ByteCounter routedMessageCtr
protected java.lang.String l10n(java.lang.String key)
protected java.lang.String l10n(java.lang.String key, java.lang.String[] patterns, java.lang.String[] values)
public void start() throws NodeInitException
NodeInitException
public freenet.node.NodeStats.RejectReason shouldRejectRequest(boolean canAcceptAnyway, boolean isInsert, boolean isSSK, boolean isLocal, boolean isOfferReply, PeerNode source, boolean hasInStore, boolean preferInsert, boolean realTimeFlag, UIDTag tag)
canAcceptAnyway
- Periodically we ignore the ping time and accept a
request anyway. This is because the ping time partly depends on whether
we have accepted any requests... FIXME this should be reconsidered.isInsert
- Whether this is an insert.isSSK
- Whether this is a request/insert for an SSK.isLocal
- Is this request originated locally? This can affect our
estimate of likely bandwidth usage. Whether it should be used is unclear,
since an attacker can observe bandwidth usage. It is configurable.isOfferReply
- Is this request actually a GetOfferedKey? This is a
non-relayed fetch of a block which we recently offered via ULPRs.source
- The node that sent us this request. This should be null
on local requests and non-null on remote requests, but in some parts of
the code that doesn't always hold. It *should* hold here, but that needs
more checking before we can remove isLocal.hasInStore
- If this is a request, do we have the block in the
datastore already? This affects whether we accept it, which gives a
significant performance gain. Arguably there is a security issue,
although timing attacks are pretty easy anyway, and making requests go
further may give attackers more samples...preferInsert
- If true, prefer inserts to requests (slightly). There
is a flag for this on inserts. The idea is that when inserts are
misrouted this causes long-term problems because the data is stored in
the wrong place. New load management should avoid the need for this.realTimeFlag
- Is this a realtime request (low latency, low capacity)
or a bulk request (high latency, high capacity)? They are accounted for
separately.public int calculateMaxTransfersOut(PeerNode peer, boolean realTime, double nonOverheadFraction, int maxTransfersOutUpperLimit)
public double getLowerLimit(double upperLimit, int peerCount)
public int outwardTransfersPerInsert()
public double getBwlimitDelayTimeRT()
public double getBwlimitDelayTimeBulk()
public double getBwlimitDelayTime()
public double getNodeAveragePingTime()
public int getOpennetSizeEstimate(long timestamp)
public int getDarknetSizeEstimate(long timestamp)
public java.lang.Object[] getKnownLocations(long timestamp)
public double pRejectIncomingInstantly()
public double pRejectIncomingInstantlyCHKRequestRT()
public double pRejectIncomingInstantlyCHKInsertRT()
public double pRejectIncomingInstantlySSKRequestRT()
public double pRejectIncomingInstantlySSKInsertRT()
public double pRejectIncomingInstantlyCHKRequestBulk()
public double pRejectIncomingInstantlyCHKInsertBulk()
public double pRejectIncomingInstantlySSKRequestBulk()
public double pRejectIncomingInstantlySSKInsertBulk()
public void maybeUpdatePeerManagerUserAlertStats(long now)
public SimpleFieldSet persistThrottlesToFieldSet()
persistThrottlesToFieldSet
in interface Persistable
public void maybeUpdateNodeIOStats(long now)
public long[] getNodeIOStats()
public void waitUntilNotOverloaded(boolean isInsert)
public int getActiveThreadCount()
public int[] getActiveThreadsByPriority()
public int[] getWaitingThreadsByPriority()
public int getThreadLimit()
public java.lang.Thread[] getThreads()
public SimpleFieldSet exportVolatileFieldSet()
public boolean isTestnetEnabled()
public boolean getRejectReasonsTable(HTMLNode table)
public boolean getLocalRejectReasonsTable(HTMLNode table)
public void requestCompleted(boolean succeeded, boolean isRemote, boolean isSSK)
public void fillSuccessRateBox(HTMLNode parent)
public void requestSentBytes(boolean ssk, int x)
public void requestReceivedBytes(boolean ssk, int x)
public void insertSentBytes(boolean ssk, int x)
public void insertReceivedBytes(boolean ssk, int x)
public long getCHKRequestTotalBytesSent()
public long getSSKRequestTotalBytesSent()
public long getCHKInsertTotalBytesSent()
public long getSSKInsertTotalBytesSent()
public void offeredKeysSenderReceivedBytes(int x)
public void offeredKeysSenderSentBytes(int x)
public long getOfferedKeysTotalBytesReceived()
public long getOfferedKeysTotalBytesSent()
public long getOffersSentBytesSent()
public void swappingReceivedBytes(int x)
public void swappingSentBytes(int x)
public long getSwappingTotalBytesReceived()
public long getSwappingTotalBytesSent()
public void reportAuthBytes(int x)
public long getTotalAuthBytesSent()
public long getResendBytesSent()
public void reportUOMBytesSent(int x)
public long getUOMBytesSent()
public long getAnnounceBytesSent()
public long getAnnounceBytesPayloadSent()
public long getRoutingStatusBytes()
public void networkColoringReceivedBytes(int x)
public void networkColoringSentBytes(int x)
public long getNetworkColoringSentBytes()
public void pingCounterReceived(int x)
public void pingCounterSent(int x)
public long getPingSentBytes()
public long getProbeRequestSentBytes()
public long getRoutedMessageSentBytes()
public long getDisconnBytesSent()
public long getInitialMessagesBytesSent()
public long getChangedIPBytesSent()
public long getNodeToNodeBytesSent()
public long getAllocationNoticesBytesSent()
public long getFOAFBytesSent()
public long getNotificationOnlyPacketsSentBytes()
public long getSentOverhead()
public double getSentOverheadPerSecond()
public void successfulBlockReceive(boolean realTimeFlag, boolean isLocal)
public void failedBlockReceive(boolean normalFetch, boolean timeout, boolean realTimeFlag, boolean isLocal)
public void reportIncomingRequestLocation(double loc)
public int[] getIncomingRequestLocation(int[] retval)
public void reportOutgoingLocalRequestLocation(double loc)
public int[] getOutgoingLocalRequestLocation(int[] retval)
public void reportOutgoingRequestLocation(double loc)
public int[] getOutgoingRequestLocation(int[] retval)
public void reportCHKOutcome(long rtt, boolean successful, double location, boolean isRealtime)
public void reportSSKOutcome(long rtt, boolean successful, boolean isRealtime)
public void fillDetailedTimingsBox(HTMLNode html)
public void fillRemoteRequestHTLsBox(HTMLNode html, boolean realTime)
public void reportDatabaseJob(java.lang.String jobType, long executionTimeMiliSeconds)
public void reportMandatoryBackoff(java.lang.String backoffType, long backoffTimeMilliSeconds, boolean realtime)
public void reportRoutingBackoff(java.lang.String backoffType, long backoffTimeMilliSeconds, boolean realtime)
public void reportTransferBackoff(java.lang.String backoffType, long backoffTimeMilliSeconds, boolean realtime)
public StoreLocationStats chkStoreStats()
public StoreLocationStats chkCacheStats()
public StoreLocationStats chkSlashDotCacheStats()
public StoreLocationStats chkClientCacheStats()
public StoreLocationStats sskStoreStats()
public StoreLocationStats sskCacheStats()
public StoreLocationStats sskSlashDotCacheStats()
public StoreLocationStats sskClientCacheStats()
public NodeStats.TimedStats[] getMandatoryBackoffStatistics(boolean realtime)
public NodeStats.TimedStats[] getRoutingBackoffStatistics(boolean realtime)
public NodeStats.TimedStats[] getTransferBackoffStatistics(boolean realtime)
public NodeStats.TimedStats[] getDatabaseJobExecutionStatistics()
public NodeStats.PeerLoadStats createPeerLoadStats(PeerNode peer, int transfersPerInsert, boolean realTimeFlag)
public NodeStats.PeerLoadStats parseLoadStats(PeerNode source, Message m)
public freenet.node.NodeStats.RunningRequestsSnapshot getRunningRequestsTo(PeerNode peerNode, int transfersPerInsert, boolean realTimeFlag)
public boolean ignoreLocalVsRemoteBandwidthLiability()
public void reportAnnounceForwarded(int forwardedRefs, PeerNode source)
public int getTransfersPerAnnounce()
public freenet.node.NodeStats.AnnouncementDecision shouldAcceptAnnouncement(long uid)
public void endAnnouncement(long uid)
public void blockTime(long interval, boolean realtime)
blockTime
in interface BlockTransmitter.BlockTimeCallback
public long maxPeerPingTime()
public void reportNLMDelay(long waitTime, boolean realTime, boolean local)
public void drawNewLoadManagementDelayTimes(HTMLNode content)
public void reportFatalTimeoutInWait(boolean local)
public void reportAllocatedSlot(boolean local)
public boolean enableNewLoadManagement(boolean realTimeFlag)
public byte[] getNoisyRejectStats()
public final double randomNoise(double input, double sigma)
input
- Value to apply noise to.sigma
- Proportion change at one standard deviation.public final double getBandwidthLiabilityUsage()