Package jenkins.model.dashboard
Class RecentRuns
- All Implemented Interfaces:
ExtensionPoint
@Extension
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public final class RecentRuns
extends RunListener<Run<?,?>>
Remembers the last completed build of every job, for
RecentTab.
Each job has one entry, so a few busy jobs cannot push out everything else, and users who can only see
a few jobs still find their recent builds however busy the rest of the instance is. Like
Job.getLastCompletedBuild(), the entry is the job's highest-numbered completed build, also when builds
complete out of order. Runs are held
by job full name and build number rather than by reference, so this does not keep builds in memory, and an
entry takes about a hundred bytes.
The index starts empty. The first read fills it in the background from each job's last completed
build, so startup does not load any builds.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classFollows renamed, moved and deleted jobs and folders.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 -
Method Summary
Modifier and TypeMethodDescriptionstatic RecentRunsget()getCompleted(int limit) The most recently completed runs that the current user can see, newest first, one per job.voidonCompleted(Run<?, ?> run, TaskListener listener) Called after a build is completed.voidCalled right before a build is going to be deleted.Methods inherited from class hudson.model.listeners.RunListener
all, allowLoad, createLoadAllower, fireCompleted, fireDeleted, fireFinalized, fireInitialize, fireStarted, onFinalized, onInitialize, onStarted, register, setUpEnvironment, unregister
-
Constructor Details
-
RecentRuns
public RecentRuns()
-
-
Method Details
-
get
-
onCompleted
Description copied from class:RunListenerCalled after a build is completed.- Overrides:
onCompletedin classRunListener<Run<?,?>> - Parameters:
run- The completed build.listener- The listener for this build. This can be used to produce log messages, for example, which becomes a part of the "console output" of this build. But when this method runs, the build is considered completed, so its status cannot be changed anymore.
-
onDeleted
Description copied from class:RunListenerCalled right before a build is going to be deleted.- Overrides:
onDeletedin classRunListener<Run<?,?>> - Parameters:
run- The build.
-
getCompleted
The most recently completed runs that the current user can see, newest first, one per job.- Parameters:
limit- the maximum number of runs to return
-