Package se.diabol.jenkins.pipeline.model
Record Class Status
java.lang.Object
java.lang.Record
se.diabol.jenkins.pipeline.model.Status
- Record Components:
type- the statetimestamp- epoch milliseconds of the start (finished and running builds) or queue entry, 0 when unknownduration- milliseconds of a finished build, 0 otherwiseestimatedDuration- estimated milliseconds of a running build, or -1
@ExportedBean(defaultVisibility=100)
public record Status(StatusType type, long timestamp, long duration, long estimatedDuration)
extends Record
The status of a task.
timestamp is when the build started (or was queued); duration is how long a finished build took;
for a running build estimatedDuration is the job's estimate. Elapsed time and progress of a running build are
derived from the clock while exporting, so a cached status stays correct without recomputation.
-
Constructor Summary
ConstructorsConstructorDescriptionStatus(StatusType type, long timestamp, long duration, long estimatedDuration) Creates an instance of aStatusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic Statusdisabled()longduration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of theestimatedDurationrecord component.longDuration of a finished build, or the time a running build has been going on, in milliseconds.Epoch milliseconds of the last activity, or null when nothing happened yet.static Statusfinished(StatusType type, long started, long duration) final inthashCode()Returns a hash code value for this object.static Statusidle()booleanisFailed()Whether this status counts as a failure when sorting components.static StatuspausedPendingInput(long started, long estimatedDuration) progress()Progress of a running build in percent, capped at 99 until it finishes; null when not running.static Statusqueued(long since) static Statusrunning(long started, long estimatedDuration) longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Status
Creates an instance of aStatusrecord class.- Parameters:
type- the value for thetyperecord componenttimestamp- the value for thetimestamprecord componentduration- the value for thedurationrecord componentestimatedDuration- the value for theestimatedDurationrecord component
-
-
Method Details
-
idle
-
disabled
-
queued
-
running
-
pausedPendingInput
-
finished
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
exportedTimestamp
Epoch milliseconds of the last activity, or null when nothing happened yet. -
exportedDuration
@Exported(name="duration") public long exportedDuration()Duration of a finished build, or the time a running build has been going on, in milliseconds. -
progress
Progress of a running build in percent, capped at 99 until it finishes; null when not running. -
isFailed
public boolean isFailed()Whether this status counts as a failure when sorting components. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
duration
public long duration()Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-
estimatedDuration
public long estimatedDuration()Returns the value of theestimatedDurationrecord component.- Returns:
- the value of the
estimatedDurationrecord component
-