- All Known Implementing Classes:
ProfileManagerImpl
public interface ProfileManager
Manages peer profiles and performance metrics for router peers. Tracks communication statistics, tunnel participation, and database interactions to maintain performance profiles for network peers.
Method Summary
All MethodsModifier and TypeMethodDescriptionvoidcommErrorOccurred(Hash peer) Note that there was some sort of communication error talking with the peer.voiddbLookupFailed(Hash peer) Note that the peer was unable to reply to a db lookup - either with data or with a lookupReply redirecting the user elsewhere.voiddbLookupReceived(Hash peer) Note that the local router received a db lookup from the given peer.voiddbLookupReply(Hash peer, int newPeers, int oldPeers, int invalid, int duplicate, long responseTimeMs) The peer replied to a db lookup with a redirect to other routers.voiddbLookupSuccessful(Hash peer, long responseTimeMs) Note that the peer was able to return the valid data for a db lookup.voiddbStoreFailed(Hash peer) Note that we were unable to confirm a successful send of db data to the peer, at least not within our timeout period.voiddbStoreReceived(Hash peer, boolean wasNewKey) Note that the local router received an unprompted db store from the given peer.voiddbStoreSent(Hash peer, long responseTimeMs) Note that we've confirmed a successful send of db data to the peer (though we haven't necessarily requested it again from them, so they /might/ be lying).voiddbStoreSuccessful(Hash peer) Note that we confirmed a successful send of db data to the peer.voidheardAbout(Hash peer) Note that the local router received a reference to the given peer, either through an explicit dbStore or in a dbLookupReply.voidheardAbout(Hash peer, long when) Note that the local router received a reference to the given peer at a specific time.voidmessageFailed(Hash peer) Note that the router failed to send a message to the peer over any transport.voidmessageFailed(Hash peer, String transport) Note that the router failed to send a message to the peer over the transport specified.voidmessageReceived(Hash peer, String style, long msToReceive, int bytesRead) Note that the router received a message from the given peer on the specified transport.voidmessageSent(Hash peer, String transport, long msToSend, long bytesSent) Note that it took msToSend to send a message of size bytesSent to the peer over the transport.voidpeerLossEvent(Hash peer, float ratio) Record the packet-loss (retransmit) ratio measured by the transport for a peer.voidtunnelDataPushed(Hash peer, long rtt, long size) Note that we were able to push some data through a tunnel that the peer is participating in (detected after rtt).voidtunnelDataPushed1m(Hash peer, long size) Note that the peer is participating in a tunnel that pushed the given amount of data over the last minute.voidtunnelFailed(Hash peer, int pct) Note that the peer participated in a tunnel that failed.voidtunnelJoined(Hash peer, long responseTimeMs) Note that the router agreed to participate in a tunnel.voidtunnelLifetimePushed(Hash peer, long lifetime, long size) Note that we were able to push the given amount of data through a tunnel that the peer is participating in.voidtunnelRejected(Hash peer, long responseTimeMs, int severity) Note that a router explicitly rejected joining a tunnel.voidtunnelTestSucceeded(Hash peer, long responseTimeMs) Note that a tunnel that the router is participating in was successfully tested with the given round trip latency.voidtunnelTimedOut(Hash peer) Note that a router timed out joining a tunnel.
Method Details
messageSent
Note that it took msToSend to send a message of size bytesSent to the peer over the transport. This should only be called if the transport considered the send successful.- Parameters:
peer- hash of the peer the message was sent totransport- style of the transport that carried the messagemsToSend- milliseconds the send tookbytesSent- size of the message in bytes
peerLossEvent
Record the packet-loss (retransmit) ratio measured by the transport for a peer.- Parameters:
peer- hash of the peer the packet loss was measured onratio- retransmitted / transmitted packets, 0.0 = healthy
messageFailed
messageFailed
Note that the router failed to send a message to the peer over any transport.- Parameters:
peer- hash of the peer the send to failed
commErrorOccurred
Note that there was some sort of communication error talking with the peer.- Parameters:
peer- hash of the peer the error occurred talking to
tunnelJoined
Note that the router agreed to participate in a tunnel.- Parameters:
peer- hash of the peer that agreed to joinresponseTimeMs- milliseconds the peer took to accept the request
tunnelRejected
Note that a router explicitly rejected joining a tunnel.- Parameters:
peer- who rejected usresponseTimeMs- how long it took to get the rejectionseverity- how much the peer doesnt want to participate in the tunnel (large == more severe)
tunnelTimedOut
Note that a router timed out joining a tunnel.- Parameters:
peer- who rejected us
tunnelTestSucceeded
Note that a tunnel that the router is participating in was successfully tested with the given round trip latency.- Parameters:
peer- hash of the peer on the far end of the tunnelresponseTimeMs- round trip latency of the test in milliseconds
tunnelDataPushed
Note that we were able to push some data through a tunnel that the peer is participating in (detected after rtt).- Parameters:
peer- hash of the peer participating in the tunnelrtt- round trip latency in milliseconds, not used in the rate accountingsize- bytes pushed, accumulated into a long so a period total exceeding 2 GB is not truncated
tunnelDataPushed1m
Note that the peer is participating in a tunnel that pushed the given amount of data over the last minute.- Parameters:
peer- hash of the peer participating in the tunnelsize- bytes pushed during the period, normalized to a minute
tunnelLifetimePushed
Note that we were able to push the given amount of data through a tunnel that the peer is participating in.- Parameters:
peer- hash of the peer participating in the tunnellifetime- age of the tunnel in millisecondssize- bytes pushed over the lifetime of the tunnel
tunnelFailed
Note that the peer participated in a tunnel that failed. Its failure may not have been the peer's fault however.- Parameters:
peer- hash of the peer that participated in the tunnelpct- chance of blaming the peer for the failure, 0-100 percent
dbLookupSuccessful
Note that the peer was able to return the valid data for a db lookup.- Parameters:
peer- hash of the peer that answeredresponseTimeMs- milliseconds the peer took to answer
dbLookupFailed
Note that the peer was unable to reply to a db lookup - either with data or with a lookupReply redirecting the user elsewhere.- Parameters:
peer- hash of the peer that did not answer
dbLookupReply
void dbLookupReply(Hash peer, int newPeers, int oldPeers, int invalid, int duplicate, long responseTimeMs) The peer replied to a db lookup with a redirect to other routers. The redirect list included newPeers routers we did not previously know about, oldPeers routers we already had profiles for, the given invalid routers that were unusable, and a count of duplicates we had explicitly asked them not to send but they did anyway.- Parameters:
peer- hash of the peer that sent the redirectnewPeers- redirected routers we did not previously know aboutoldPeers- redirected routers we already had profiles forinvalid- redirected routers that were unusableduplicate- redirected routers we had explicitly excludedresponseTimeMs- milliseconds the peer took to answer
dbLookupReceived
Note that the local router received a db lookup from the given peer.- Parameters:
peer- hash of the peer that sent the lookup to us
dbStoreReceived
Note that the local router received an unprompted db store from the given peer.- Parameters:
peer- hash of the peer that sent the storewasNewKey- true if the stored key was not already in our database
dbStoreSent
Note that we've confirmed a successful send of db data to the peer (though we haven't necessarily requested it again from them, so they /might/ be lying).- Parameters:
peer- hash of the peer we sent the data toresponseTimeMs- milliseconds the peer took to acknowledge it
dbStoreSuccessful
Note that we confirmed a successful send of db data to the peer.- Parameters:
peer- hash of the peer that verified the stored data
dbStoreFailed
Note that we were unable to confirm a successful send of db data to the peer, at least not within our timeout period.- Parameters:
peer- hash of the peer that did not verify the stored data
heardAbout
Note that the local router received a reference to the given peer, either through an explicit dbStore or in a dbLookupReply.- Parameters:
peer- the hash of the peer we learned about
heardAbout
Note that the local router received a reference to the given peer at a specific time.- Parameters:
peer- the hash of the peer we learned aboutwhen- the timestamp when we learned about the peer
messageReceived
Note that the router received a message from the given peer on the specified transport. Messages received without any "from" information aren't recorded through this metric. If msToReceive is negative, there was no timing information available.- Parameters:
peer- hash of the peer that sent the messagestyle- transport style the message arrived overmsToReceive- milliseconds the receive took, negative if untimedbytesRead- size of the message in bytes