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
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
Modifier and TypeFieldDescriptionstatic final Double
This is the CPU usage threshold.static final int
Consecutive high CPUs to take a thread dumpstatic final int
Limit the number of thread dumps to retain on high cpuprotected final FileListCap
Thread dumps generated on high CPU load are stored in $JENKINS_HOME/high-load/cpustatic final int
Recurrence period to check high cpu load consumption.Fields inherited from class hudson.model.PeriodicWork
DAY, HOUR, logger, MIN
-
Constructor Summary
-
Method Summary
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 Details
-
RECURRENCE_PERIOD_SEC
public static final int RECURRENCE_PERIOD_SECRecurrence 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_TIMESConsecutive high CPUs to take a thread dump -
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_RETAINLimit the number of thread dumps to retain on high cpu -
logs
Thread dumps generated on high CPU load are stored in $JENKINS_HOME/high-load/cpu
-
-
Constructor Details
-
HighLoadCpuChecker
public HighLoadCpuChecker()
-
-
Method Details
-
getRecurrencePeriod
public long getRecurrencePeriod()- Specified by:
getRecurrencePeriod
in classPeriodicWork
-
doRun
- Specified by:
doRun
in classSafeTimerTask
- Throws:
Exception
-