public class TestJob extends JobImpl
| Modifier and Type | Field and Description |
|---|---|
static int | maxQueuedTestsMaximum number of TestJob instances that should be queued before deferring new ones. |
| Constructor and Description |
|---|
TestJob(RouterContext ctx,
PooledTunnelCreatorConfig cfg,
TunnelPool pool)TestJob. |
| Modifier and Type | Method and Description |
|---|---|
void | dropped()Called when the job is dropped due to router overload. |
static int | getCurrentTestJobCount()Get the current number of queued + active test jobs for capacity planning. |
static int | getHardLimit(RouterContext ctx)Hard limit for total TestJob instances (queued + active). |
static int | getMaxTestJobs()Get the maximum number of queued test jobs allowed before deferring. |
String | getName()Descriptive name of the task |
boolean | isValid()Check if this TestJob instance is valid and should be queued. |
void | runJob()runJob. |
static boolean | shouldSchedule(RouterContext ctx,
PooledTunnelCreatorConfig cfg)Static method to check if a TestJob should be created and scheduled. |
void | testSuccessful(int ms)Called when the tunnel test completes successfully. |
getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringpublic static volatile int maxQueuedTests
public TestJob(RouterContext ctx, PooledTunnelCreatorConfig cfg, TunnelPool pool)
public void dropped()
public static int getCurrentTestJobCount()
public static int getHardLimit(RouterContext ctx)
public static int getMaxTestJobs()
public String getName()
Jobpublic boolean isValid()
public void runJob()
public static boolean shouldSchedule(RouterContext ctx, PooledTunnelCreatorConfig cfg)
ctx - the router contextcfg - the tunnel configpublic void testSuccessful(int ms)
ms - time in milliseconds the test took to succeed