Class StatsdNotifier
java.lang.Object
org.jenkinsci.plugins.githubautostatus.notifiers.BuildNotifier
org.jenkinsci.plugins.githubautostatus.notifiers.StatsdNotifier
- All Implemented Interfaces:
ExtensionPoint
Sends job and stage metrics to a StatsD collector server over UDP.
- Author:
- Tom Hadlaw (thomas.hadlaw@hootsuite.com)
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsFields inherited from class org.jenkinsci.plugins.githubautostatus.notifiers.BuildNotifier
DEFAULT_LONG, DEFAULT_STRING -
Constructor Summary
ConstructorsConstructorDescriptionStatsdNotifier(StatsdNotifierConfig config) StatsdNotifier(StatsdWrapper client, StatsdNotifierConfig config) -
Method Summary
Modifier and TypeMethodDescriptionReturns the StatsD including the global prefix up to the branch bucket.booleanDetermines whether this notifier is enabled.voidnotifyBuildStageStatus(String jobName, String nodeName, BuildStage.State buildState, long nodeDuration) Sends duration metric to StatsD by doing a timer metric - actual implementation.voidnotifyBuildStageStatus(String jobName, BuildStage stageItem) Sends duration metric to StatsD by doing a timer metric - interface-dictated wrapper aroundnotifyBuildStageStatus(String, String, BuildStage.State, long).voidnotifyFinalBuildStatus(BuildStage.State buildState, Map<String, Object> parameters) Sends final build status metric by doing a timer metric for blocked and unblocked job time.sanitizeAll(String key) Applies all sanitizations to a key, folders are expanded into separate StatsD buckets.voidsendNonStageError(String jobName, String nodeName) Sends build status metric to StatsD by doing an increment on the buildState categories.Methods inherited from class org.jenkinsci.plugins.githubautostatus.notifiers.BuildNotifier
all, getLong, wantsOutOfStageErrors
-
Field Details
-
config
-
-
Constructor Details
-
StatsdNotifier
-
StatsdNotifier
-
-
Method Details
-
isEnabled
public boolean isEnabled()Determines whether this notifier is enabled.- Specified by:
isEnabledin classBuildNotifier- Returns:
- true if enabled; false otherwise
-
getBranchPath
Returns the StatsD including the global prefix up to the branch bucket.- Returns:
- string of path up to branch bucket
-
notifyBuildStageStatus
Sends duration metric to StatsD by doing a timer metric - interface-dictated wrapper aroundnotifyBuildStageStatus(String, String, BuildStage.State, long).- Specified by:
notifyBuildStageStatusin classBuildNotifier- Parameters:
jobName- the name of the job (currently ignored, required for interface)stageItem- stage item describing the new state (its name and state is what gets reported)
-
notifyBuildStageStatus
public void notifyBuildStageStatus(String jobName, String nodeName, BuildStage.State buildState, long nodeDuration) Sends duration metric to StatsD by doing a timer metric - actual implementation.- Parameters:
jobName- the name of the job (currently ignored)nodeName- the name of the node (stage)buildState- the new statenodeDuration- the duration of the node
-
notifyFinalBuildStatus
Sends final build status metric by doing a timer metric for blocked and unblocked job time.- Specified by:
notifyFinalBuildStatusin classBuildNotifier- Parameters:
buildState- the reported stateparameters- build parameters
-
sendNonStageError
Sends build status metric to StatsD by doing an increment on the buildState categories.- Parameters:
jobName- name of the job (currently ignored)nodeName- the stage of the status on which to report on
-
sanitizeAll
Applies all sanitizations to a key, folders are expanded into separate StatsD buckets. It first applies bucket sanitization (removing periods to prevent them being interpreted as separate buckets). It then applies the StatsD bucket key sanitization.- Parameters:
key- key to sanitize- Returns:
- sanitized key
-