Class HighLoadCpuChecker
- java.lang.Object
-
- java.util.TimerTask
-
- hudson.triggers.SafeTimerTask
-
- hudson.model.PeriodicWork
-
- com.cloudbees.jenkins.support.threaddump.HighLoadCpuChecker
-
- All Implemented Interfaces:
ExtensionPoint
,Runnable
@Extension public class HighLoadCpuChecker extends PeriodicWork
PeriodicWork to check when there is a high load in the instance. Only checking high CPU usage for the moment, but it can be used to generate thread dumps in high heap memory consumption.
-
-
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 Double
CPU_USAGE_THRESHOLD
This is the CPU usage threshold.static int
HIGH_CPU_CONSECUTIVE_TIMES
Consecutive high CPUs to take a thread dumpstatic int
HIGH_CPU_THREAD_DUMPS_TO_RETAIN
Limit the number of thread dumps to retain on high cpuprotected FileListCap
logs
Thread dumps generated on high CPU load are stored in $JENKINS_HOME/high-load/cpustatic int
RECURRENCE_PERIOD_SEC
Recurrence period to check high cpu load consumption.-
Fields inherited from class hudson.model.PeriodicWork
DAY, HOUR, logger, MIN
-
-
Constructor Summary
Constructors Constructor Description HighLoadCpuChecker()
-
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
Recurrence period to check high cpu load consumption. Thread dumps after there are CONSECUTIVE_HIGH_CPU in the RECURRENCE_PERIOD_SEC
-
HIGH_CPU_CONSECUTIVE_TIMES
public static final int HIGH_CPU_CONSECUTIVE_TIMES
Consecutive high CPUs to take a thread dump
-
CPU_USAGE_THRESHOLD
public static final Double CPU_USAGE_THRESHOLD
This is the CPU usage threshold. Determinate de percentage of the total CPU used across all the cores available
-
HIGH_CPU_THREAD_DUMPS_TO_RETAIN
public static final int HIGH_CPU_THREAD_DUMPS_TO_RETAIN
Limit the number of thread dumps to retain on high cpu
-
logs
protected final FileListCap logs
Thread dumps generated on high CPU load are stored in $JENKINS_HOME/high-load/cpu
-
-
Method Detail
-
getRecurrencePeriod
public long getRecurrencePeriod()
- Specified by:
getRecurrencePeriod
in classPeriodicWork
-
doRun
protected void doRun() throws Exception
- Specified by:
doRun
in classSafeTimerTask
- Throws:
Exception
-
-