Class SlowRequestChecker
- java.lang.Object
-
- java.util.TimerTask
-
- hudson.triggers.SafeTimerTask
-
- hudson.model.PeriodicWork
-
- com.cloudbees.jenkins.support.slowrequest.SlowRequestChecker
-
- All Implemented Interfaces:
ExtensionPoint
,Runnable
@Extension public class SlowRequestChecker extends PeriodicWork
Run periodically to find slow requests and track them.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.triggers.SafeTimerTask
SafeTimerTask.ExceptionRunnable
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DISABLED
Provide a means to disable the slow request checker.static int
RECURRENCE_PERIOD_SEC
How often to run the slow request checkerstatic int
THRESHOLD
Time in milliseconds that's considered too slow for requests.-
Fields inherited from class hudson.model.PeriodicWork
DAY, HOUR, logger, MIN
-
-
Constructor Summary
Constructors Constructor Description SlowRequestChecker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doRun()
long
getRecurrencePeriod()
-
Methods inherited from class hudson.model.PeriodicWork
all, getInitialDelay, init
-
Methods inherited from class hudson.triggers.SafeTimerTask
getLogsRoot, of, run
-
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
-
-
-
Field Detail
-
RECURRENCE_PERIOD_SEC
public static final int RECURRENCE_PERIOD_SEC
How often to run the slow request checker- Since:
- 2.12
-
THRESHOLD
public static final int THRESHOLD
Time in milliseconds that's considered too slow for requests. Starting with a bit conservative value to catch serious offenders first. If this value is less than twiceRECURRENCE_PERIOD_SEC
then that will be used instead.
-
DISABLED
public static volatile boolean DISABLED
Provide a means to disable the slow request checker. This is a volatile non-final field as if you run into issues in a running Jenkins you may need to disable without restarting Jenkins.- Since:
- 2.12
-
-
Method Detail
-
getRecurrencePeriod
public long getRecurrencePeriod()
- Specified by:
getRecurrencePeriod
in classPeriodicWork
-
doRun
protected void doRun() throws Exception
- Specified by:
doRun
in classSafeTimerTask
- Throws:
Exception
-
-