@Extension public class DatadogBuildListener extends RunListener<Run>
RunListener
to trigger events and calculate metrics:
- When a build initializes, the onInitialize(Run)
method will be invoked.
- When a build starts, the onStarted(Run, TaskListener)
method will be invoked.
- When a build completes, the onCompleted(Run, TaskListener)
method will be invoked.
- When a build finalizes, the onFinalized(Run)
method will be invoked.ExtensionPoint.LegacyInstancesAreScopedToHudson
LISTENERS, targetType
Constructor and Description |
---|
DatadogBuildListener() |
Modifier and Type | Method and Description |
---|---|
DatadogClient |
getDatadogClient() |
Queue |
getQueue() |
com.cloudbees.workflow.rest.external.RunExt |
getRunExtForRun(org.jenkinsci.plugins.workflow.job.WorkflowRun run) |
void |
onCompleted(Run run,
TaskListener listener)
Called when a build is completed.
|
void |
onDeleted(Run run) |
void |
onFinalized(Run run)
Called when a build is finalized.
|
void |
onInitialize(Run run)
Called when a build is first initialized.
|
void |
onStarted(Run run,
TaskListener listener)
Called when a build is first started.
|
Environment |
setUpEnvironment(AbstractBuild build,
Launcher launcher,
BuildListener listener)
Called before the SCMCheckout is run in a Jenkins build.
|
all, fireCompleted, fireDeleted, fireFinalized, fireInitialize, fireStarted, register, unregister
public void onInitialize(Run run)
onInitialize
in class RunListener<Run>
run
- - A Run object representing a particular execution of Job.public Environment setUpEnvironment(AbstractBuild build, Launcher launcher, BuildListener listener) throws Run.RunnerAbortedException
setUpEnvironment
in class RunListener<Run>
Run.RunnerAbortedException
public void onStarted(Run run, TaskListener listener)
onStarted
in class RunListener<Run>
run
- - A Run object representing a particular execution of Job.listener
- - A TaskListener object which receives events that happen during some
operation.public void onCompleted(Run run, @Nonnull TaskListener listener)
onCompleted
in class RunListener<Run>
run
- - A Run object representing a particular execution of Job.listener
- - A TaskListener object which receives events that happen during some
operation.public void onFinalized(Run run)
onFinalized
in class RunListener<Run>
run
- - A Run object representing a particular execution of Job.public void onDeleted(Run run)
onDeleted
in class RunListener<Run>
public com.cloudbees.workflow.rest.external.RunExt getRunExtForRun(org.jenkinsci.plugins.workflow.job.WorkflowRun run)
public Queue getQueue()
public DatadogClient getDatadogClient()
Copyright © 2016–2023. All rights reserved.