java.lang.Object
net.i2p.router.tunnel.pool.TunnelPeerSelector.KeepAliveTally
Enclosing class:
TunnelPeerSelector

static final class TunnelPeerSelector.KeepAliveTallyextends Object
Per-cycle tally of why keepalive did not act on the peers it selected.

Added because the candidate pool was observed shrinking from roughly 395 peers per cycle to roughly 203, and the pre-existing log line only reported how many peers were kept alive, never how many were dropped on the way. Without a reason for each drop, an eroding pool and a busy pool look identical from the outside.

Note that the fall from 395 to 203 is supply, not delivery: the action budget sits at 200, so the cycle was servicing its full budget in both periods and only the surplus above it collapsed.

describe(boolean) is pure so the summary can be asserted in a test without a router.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) int
    Peers the selector asked for, before any filtering.
    (package private) int
    Distinct peers the two tier selectors returned.
    (package private) int
    Acted on: sent a keepalive DLM.
    (package private) int
    Acted on: started an establishment.
    (package private) int
    Skipped: recorded as a recent first-hop failure and still in cooldown.
    (package private) int
    Skipped: RouterInfo present but no usable transport address.
    (package private) int
    Skipped: no RouterInfo to address.
    (package private) int
    Skipped: no transport available to accept the probe.
    (package private) int
    Skipped: already serviced inside this keepalive interval.
    (package private) int
    Skipped: no contact within the activity window.
    (package private) int
    Never reached: the per-cycle action budget was already spent.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Every counter starts at 0; the cycle fills them in as it selects and acts, and describe(boolean) reads them back.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    (package private) int
    Peers the cycle actually acted on: a keepalive DLM sent, or an establishment started.
    (package private) String
    describe(boolean aggressive)
    Summarise the cycle.
    (package private) int
    Peers selected but never acted on for any reason.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • budget

      int budget
      Peers the selector asked for, before any filtering.

      This is the per-tier request doubled for the two tiers, not a count of anything on the wire.

    • candidates

      int candidates
      Distinct peers the two tier selectors returned.

      Named candidates rather than delivered because it is fixed before the cycle sends anything: it measures supply, not delivery. A previous field name of delivered sat on this same value and read as "203 delivered of 400 requested", which was mistaken twice for a fall in successful keepalives when it only ever showed the candidate pool.

      May exceed budget, which is the sum of the two nominal tier requests rather than a cap. selectFastPeers backfills from the high-capacity tier when the fast tier cannot fill its depth, and each selector adds up to its own depth to whatever the set already holds.

    • keepalived

      int keepalived
      Acted on: sent a keepalive DLM.
    • preConnected

      int preConnected
      Acted on: started an establishment.
    • skipCooldown

      int skipCooldown
      Skipped: recorded as a recent first-hop failure and still in cooldown.
    • skipStale

      int skipStale
      Skipped: no contact within the activity window.
    • skipRecent

      int skipRecent
      Skipped: already serviced inside this keepalive interval.
    • skipNoRouterInfo

      int skipNoRouterInfo
      Skipped: no RouterInfo to address.
    • skipNoAddress

      int skipNoAddress
      Skipped: RouterInfo present but no usable transport address.
    • skipNoTransport

      int skipNoTransport
      Skipped: no transport available to accept the probe.
    • unprocessed

      int unprocessed
      Never reached: the per-cycle action budget was already spent.
  • Constructor Details

    • KeepAliveTally

      KeepAliveTally()
      Every counter starts at 0; the cycle fills them in as it selects and acts, and describe(boolean) reads them back.
  • Method Details

    • actedOn

      int actedOn()
      Peers the cycle actually acted on: a keepalive DLM sent, or an establishment started. This is the figure that means delivery.
      Returns:
      keepalived plus preConnected
    • describe

      String describe(boolean aggressive)
      Summarise the cycle.

      Reports supply (candidates of budget) separately from delivery (actedOn), because conflating them hides which of the two actually fell.

      Parameters:
      aggressive - whether this was an aggressive cycle
      Returns:
      the cycle summary on three lines: supply and delivery, then the skip reasons split across two \n* continuation lines
    • unaccounted

      int unaccounted()
      Peers selected but never acted on for any reason.

      Every selected peer must land in exactly one bucket, so this is the check that the accounting has not lost a path.

      Returns:
      the number of candidate peers with no recorded disposition