Class DatadogBuildListener
- java.lang.Object
-
- hudson.model.listeners.RunListener<Run>
-
- org.datadog.jenkins.plugins.datadog.listeners.DatadogBuildListener
-
- All Implemented Interfaces:
ExtensionPoint
@Extension public class DatadogBuildListener extends RunListener<Run>
This class registers anRunListenerto trigger events and calculate metrics: - When a build initializes, theonInitialize(Run)method will be invoked. - When a build starts, theonStarted(Run, TaskListener)method will be invoked. - When a build completes, theonCompleted(Run, TaskListener)method will be invoked. - When a build finalizes, theonFinalized(Run)method will be invoked.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.listeners.RunListener
LISTENERS, targetType
-
-
Constructor Summary
Constructors Constructor Description DatadogBuildListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatadogClientgetDatadogClient()QueuegetQueue()com.cloudbees.workflow.rest.external.RunExtgetRunExtForRun(org.jenkinsci.plugins.workflow.job.WorkflowRun run)voidonCompleted(Run run, TaskListener listener)Called when a build is completed.voidonDeleted(Run run)voidonFinalized(Run run)Called when a build is finalized.voidonInitialize(Run run)Called when a build is first initialized.voidonStarted(Run run, TaskListener listener)Called when a build is first started.EnvironmentsetUpEnvironment(AbstractBuild build, Launcher launcher, BuildListener listener)Called before the SCMCheckout is run in a Jenkins build.-
Methods inherited from class hudson.model.listeners.RunListener
all, fireCompleted, fireDeleted, fireFinalized, fireInitialize, fireStarted, register, unregister
-
-
-
-
Method Detail
-
onInitialize
public void onInitialize(Run run)
Called when a build is first initialized.- Overrides:
onInitializein classRunListener<Run>- Parameters:
run- - A Run object representing a particular execution of Job.
-
setUpEnvironment
public Environment setUpEnvironment(AbstractBuild build, Launcher launcher, BuildListener listener) throws Run.RunnerAbortedException
Called before the SCMCheckout is run in a Jenkins build. This method is called after onInitialize callback.- Overrides:
setUpEnvironmentin classRunListener<Run>- Throws:
Run.RunnerAbortedException
-
onStarted
public void onStarted(Run run, TaskListener listener)
Called when a build is first started.- Overrides:
onStartedin classRunListener<Run>- Parameters:
run- - A Run object representing a particular execution of Job.listener- - A TaskListener object which receives events that happen during some operation.
-
onCompleted
public void onCompleted(Run run, @Nonnull TaskListener listener)
Called when a build is completed.- Overrides:
onCompletedin classRunListener<Run>- Parameters:
run- - A Run object representing a particular execution of Job.listener- - A TaskListener object which receives events that happen during some operation.
-
onFinalized
public void onFinalized(Run run)
Called when a build is finalized.- Overrides:
onFinalizedin classRunListener<Run>- Parameters:
run- - A Run object representing a particular execution of Job.
-
onDeleted
public void onDeleted(Run run)
- Overrides:
onDeletedin classRunListener<Run>
-
getRunExtForRun
public com.cloudbees.workflow.rest.external.RunExt getRunExtForRun(org.jenkinsci.plugins.workflow.job.WorkflowRun run)
-
getQueue
public Queue getQueue()
-
getDatadogClient
public DatadogClient getDatadogClient()
-
-