- Enclosing class:
TunnelPeerSelector
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
FieldsModifier and TypeFieldDescription(package private) intPeers the selector asked for, before any filtering.(package private) intDistinct peers the two tier selectors returned.(package private) intActed on: sent a keepalive DLM.(package private) intActed on: started an establishment.(package private) intSkipped: recorded as a recent first-hop failure and still in cooldown.(package private) intSkipped: RouterInfo present but no usable transport address.(package private) intSkipped: no RouterInfo to address.(package private) intSkipped: no transport available to accept the probe.(package private) intSkipped: already serviced inside this keepalive interval.(package private) intSkipped: no contact within the activity window.(package private) intNever reached: the per-cycle action budget was already spent.Constructor Summary
ConstructorsConstructorDescriptionEvery counter starts at 0; the cycle fills them in as it selects and acts, anddescribe(boolean)reads them back.Method Summary
All Methods
Field Details
budget
int budgetPeers 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 candidatesDistinct peers the two tier selectors returned.Named
candidatesrather thandeliveredbecause it is fixed before the cycle sends anything: it measures supply, not delivery. A previous field name ofdeliveredsat 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.selectFastPeersbackfills 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 keepalivedActed on: sent a keepalive DLM.preConnected
int preConnectedActed on: started an establishment.skipCooldown
int skipCooldownSkipped: recorded as a recent first-hop failure and still in cooldown.skipStale
int skipStaleSkipped: no contact within the activity window.skipRecent
int skipRecentSkipped: already serviced inside this keepalive interval.skipNoRouterInfo
int skipNoRouterInfoSkipped: no RouterInfo to address.skipNoAddress
int skipNoAddressSkipped: RouterInfo present but no usable transport address.skipNoTransport
int skipNoTransportSkipped: no transport available to accept the probe.unprocessed
int unprocessedNever 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, anddescribe(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
Summarise the cycle.Reports supply (
candidatesofbudget) 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