public class PeerTestJob extends JobImpl
This job runs continuously when enabled, selecting peers based on bandwidth tier, reachability, and version compatibility. Tests are performed by sending a DatabaseStoreMessage containing the peer's own RouterInfo back to itself through the tunnel system, measuring response times and connectivity.
Peer Selection Criteria:
Performance Impact:
Future Considerations:
| Modifier and Type | Field and Description |
|---|---|
static String | PROP_PEER_TEST_CONCURRENCYPROP_PEER_TEST_CONCURRENCY. |
static String | PROP_PEER_TEST_DELAYPROP_PEER_TEST_DELAY. |
static String | PROP_PEER_TEST_TIMEOUTPROP_PEER_TEST_TIMEOUT. |
| Constructor and Description |
|---|
PeerTestJob(RouterContext context)Creates a new PeerTestJob instance and initializes required statistics. |
| Modifier and Type | Method and Description |
|---|---|
int | getAvgPeerTestTime()Gets the average successful peer test time over the last minute. |
String | getName()Descriptive name of the task |
int | getTotalAvgPeerTestTime()Gets the total average peer test time including both successful and slow tests over the last hour. |
void | runJob()Main job execution loop that performs peer testing with adaptive scheduling. |
void | schedulePriorityTests(List<Hash> peers)Schedule peers for priority testing (e.g., from slow tunnels). |
void | startTesting(PeerManager manager)Starts the peer testing process with adaptive initial delay. |
void | stopTesting()Stops the peer testing process gracefully. |
dropped, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringpublic static final String PROP_PEER_TEST_CONCURRENCY
public static final String PROP_PEER_TEST_DELAY
public static final String PROP_PEER_TEST_TIMEOUT
public PeerTestJob(RouterContext context)
context - the router context for accessing services like logging and statisticspublic int getAvgPeerTestTime()
public String getName()
Jobpublic int getTotalAvgPeerTestTime()
public void runJob()
Adaptive Behavior:
public void schedulePriorityTests(List<Hash> peers)
peers - list of peer hashes to test urgentlypublic void startTesting(PeerManager manager)
Schedules the first test run based on router uptime:
manager - the peer manager to use for peer selectionpublic void stopTesting()
The current test round will complete, but no new rounds will be scheduled.