Package jenkins.metrics.api
Class Metrics.HealthChecker
java.lang.Object
java.util.TimerTask
hudson.triggers.SafeTimerTask
hudson.model.PeriodicWork
jenkins.metrics.api.Metrics.HealthChecker
- All Implemented Interfaces:
ExtensionPoint,Runnable
- Enclosing class:
- Metrics
Performs the periodic running of health checks and re-indexing of access keys.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.triggers.SafeTimerTask
SafeTimerTask.ExceptionRunnableNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.PeriodicWork
DAY, HOUR, logger, MIN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voiddoRun()Schedules this periodic work now in a new thread, if one isn't already running.static voidcom.codahale.metrics.Gauge<Integer>Gets theGaugethat tracks the number of health checks.Gets the most recent health check data (which includesMetrics.HealthCheckData.getLastModified())com.codahale.metrics.TimerGets theTimerthat tracks how long the health checks are taking to execute.Gets the most recent results.com.codahale.metrics.Gauge<Double>Gets theGaugethat tracks the health check score.longMethods inherited from class hudson.model.PeriodicWork
all, getInitialDelay, initMethods inherited from class hudson.triggers.SafeTimerTask
getLogsRoot, of, runMethods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
Constructor Details
-
HealthChecker
public HealthChecker()Default constructor.
-
-
Method Details
-
getRecurrencePeriod
public long getRecurrencePeriod()- Specified by:
getRecurrencePeriodin classPeriodicWork
-
getHealthCheckDuration
public com.codahale.metrics.Timer getHealthCheckDuration()Gets theTimerthat tracks how long the health checks are taking to execute.- Returns:
- the
Timerthat tracks how long the health checks are taking to execute.
-
getHealthCheckResults
@NonNull @WithBridgeMethods(java.util.Map.class) public SortedMap<String,com.codahale.metrics.health.HealthCheck.Result> getHealthCheckResults()Gets the most recent results.- Returns:
- the most recent results.
- See Also:
-
getHealthCheckData
Gets the most recent health check data (which includesMetrics.HealthCheckData.getLastModified())- Returns:
- the most recent health check data or
nullif the health checks have not run yet.
-
getHealthCheckCount
Gets theGaugethat tracks the number of health checks.- Returns:
- the
Gaugethat tracks the number of health checks.
-
getHealthCheckScore
Gets theGaugethat tracks the health check score.- Returns:
- the
Gaugethat tracks the health check score.
-
doRun
public final void doRun()Schedules this periodic work now in a new thread, if one isn't already running. Copy and paste from AsyncPeriodicWork- Specified by:
doRunin classSafeTimerTask
-
dynamicInstallHack
@Initializer(after=EXTENSIONS_AUGMENTED) @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public static void dynamicInstallHack()
-