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_ADAPTIVE_PEER_TEST |
static String |
PROP_PEER_TEST_CONCURRENCY |
static String |
PROP_PEER_TEST_DELAY |
static String |
PROP_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 |
startTesting(PeerManager manager)
Override concurrency to use aggressive mode under attack.
|
void |
stopTesting()
Stops the peer testing process gracefully.
|
dropped, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringpublic static final String PROP_ADAPTIVE_PEER_TEST
public 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()
Process flow:
Adaptive Behavior:
public void startTesting(PeerManager manager)
public void stopTesting()
The current test round will complete, but no new rounds will be scheduled.