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 Methods
    Modifier and Type
    Method
    Description
    void
    Note that there was some sort of communication error talking with the peer.
    void
    Note that the peer was unable to reply to a db lookup - either with data or with a lookupReply redirecting the user elsewhere.
    void
    Note that the local router received a db lookup from the given peer.
    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.
    void
    dbLookupSuccessful(Hash peer, long responseTimeMs)
    Note that the peer was able to return the valid data for a db lookup.
    void
    Note that we were unable to confirm a successful send of db data to the peer, at least not within our timeout period.
    void
    dbStoreReceived(Hash peer, boolean wasNewKey)
    Note that the local router received an unprompted db store from the given peer.
    void
    dbStoreSent(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).
    void
    Note that we confirmed a successful send of db data to the peer.
    void
    Note that the local router received a reference to the given peer, either through an explicit dbStore or in a dbLookupReply.
    void
    heardAbout(Hash peer, long when)
    Note that the local router received a reference to the given peer at a specific time.
    void
    Note that the router failed to send a message to the peer over any transport.
    void
    messageFailed(Hash peer, String transport)
    Note that the router failed to send a message to the peer over the transport specified.
    void
    messageReceived(Hash peer, String style, long msToReceive, int bytesRead)
    Note that the router received a message from the given peer on the specified transport.
    void
    messageSent(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.
    void
    peerLossEvent(Hash peer, float ratio)
    Record the packet-loss (retransmit) ratio measured by the transport for a peer.
    void
    tunnelDataPushed(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).
    void
    tunnelDataPushed1m(Hash peer, long size)
    Note that the peer is participating in a tunnel that pushed the given amount of data over the last minute.
    void
    tunnelFailed(Hash peer, int pct)
    Note that the peer participated in a tunnel that failed.
    void
    tunnelJoined(Hash peer, long responseTimeMs)
    Note that the router agreed to participate in a tunnel.
    void
    tunnelLifetimePushed(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.
    void
    tunnelRejected(Hash peer, long responseTimeMs, int severity)
    Note that a router explicitly rejected joining a tunnel.
    void
    tunnelTestSucceeded(Hash peer, long responseTimeMs)
    Note that a tunnel that the router is participating in was successfully tested with the given round trip latency.
    void
    Note that a router timed out joining a tunnel.
  • Method Details

    • messageSent

      void messageSent(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. This should only be called if the transport considered the send successful.
      Parameters:
      peer - hash of the peer the message was sent to
      transport - style of the transport that carried the message
      msToSend - milliseconds the send took
      bytesSent - size of the message in bytes
    • peerLossEvent

      void peerLossEvent(Hash peer, float ratio)
      Record the packet-loss (retransmit) ratio measured by the transport for a peer.
      Parameters:
      peer - hash of the peer the packet loss was measured on
      ratio - retransmitted / transmitted packets, 0.0 = healthy
    • messageFailed

      void messageFailed(Hash peer, String transport)
      Note that the router failed to send a message to the peer over the transport specified.
      Parameters:
      peer - hash of the peer the send to failed
      transport - style of the transport the send failed on
    • messageFailed

      void messageFailed(Hash peer)
      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

      void commErrorOccurred(Hash peer)
      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

      void tunnelJoined(Hash peer, long responseTimeMs)
      Note that the router agreed to participate in a tunnel.
      Parameters:
      peer - hash of the peer that agreed to join
      responseTimeMs - milliseconds the peer took to accept the request
    • tunnelRejected

      void tunnelRejected(Hash peer, long responseTimeMs, int severity)
      Note that a router explicitly rejected joining a tunnel.
      Parameters:
      peer - who rejected us
      responseTimeMs - how long it took to get the rejection
      severity - how much the peer doesnt want to participate in the tunnel (large == more severe)
    • tunnelTimedOut

      void tunnelTimedOut(Hash peer)
      Note that a router timed out joining a tunnel.
      Parameters:
      peer - who rejected us
    • tunnelTestSucceeded

      void tunnelTestSucceeded(Hash peer, long responseTimeMs)
      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 tunnel
      responseTimeMs - round trip latency of the test in milliseconds
    • tunnelDataPushed

      void tunnelDataPushed(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).
      Parameters:
      peer - hash of the peer participating in the tunnel
      rtt - round trip latency in milliseconds, not used in the rate accounting
      size - bytes pushed, accumulated into a long so a period total exceeding 2 GB is not truncated
    • tunnelDataPushed1m

      void tunnelDataPushed1m(Hash peer, long size)
      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 tunnel
      size - bytes pushed during the period, normalized to a minute
    • tunnelLifetimePushed

      void tunnelLifetimePushed(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.
      Parameters:
      peer - hash of the peer participating in the tunnel
      lifetime - age of the tunnel in milliseconds
      size - bytes pushed over the lifetime of the tunnel
    • tunnelFailed

      void tunnelFailed(Hash peer, int pct)
      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 tunnel
      pct - chance of blaming the peer for the failure, 0-100 percent
    • dbLookupSuccessful

      void dbLookupSuccessful(Hash peer, long responseTimeMs)
      Note that the peer was able to return the valid data for a db lookup.
      Parameters:
      peer - hash of the peer that answered
      responseTimeMs - milliseconds the peer took to answer
    • dbLookupFailed

      void dbLookupFailed(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.
      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 redirect
      newPeers - redirected routers we did not previously know about
      oldPeers - redirected routers we already had profiles for
      invalid - redirected routers that were unusable
      duplicate - redirected routers we had explicitly excluded
      responseTimeMs - milliseconds the peer took to answer
    • dbLookupReceived

      void dbLookupReceived(Hash peer)
      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

      void dbStoreReceived(Hash peer, boolean wasNewKey)
      Note that the local router received an unprompted db store from the given peer.
      Parameters:
      peer - hash of the peer that sent the store
      wasNewKey - true if the stored key was not already in our database
    • dbStoreSent

      void dbStoreSent(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).
      Parameters:
      peer - hash of the peer we sent the data to
      responseTimeMs - milliseconds the peer took to acknowledge it
    • dbStoreSuccessful

      void dbStoreSuccessful(Hash peer)
      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

      void dbStoreFailed(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.
      Parameters:
      peer - hash of the peer that did not verify the stored data
    • heardAbout

      void heardAbout(Hash peer)
      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

      void heardAbout(Hash peer, long when)
      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 about
      when - the timestamp when we learned about the peer
    • messageReceived

      void messageReceived(Hash peer, String style, long msToReceive, int bytesRead)
      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 message
      style - transport style the message arrived over
      msToReceive - milliseconds the receive took, negative if untimed
      bytesRead - size of the message in bytes