Package jenkins.model
Interface IExecutor
- All Known Implementing Classes:
Executor
,OneOffExecutor
@Restricted(org.kohsuke.accmod.restrictions.Beta.class)
public interface IExecutor
Interface for an executor that can be displayed in the executors widget.
- Since:
- 2.480
-
Method Summary
Modifier and TypeMethodDescriptionReturns the currentWorkUnit
(ofthe current executable
) that this executor is running.long
Gets the elapsed time since the build has started.Computes a human-readable text that shows the expected remaining time until the build completes.int
Gets the executor number that uniquely identifies it among otherIExecutor
s for the same computer.getOwner()
default ITask
int
Returns the progress of the current build in the number between 0-100.default String
Gets the string that says how long since this build has started.boolean
Checks if the current user has a permission to stop this build.boolean
isIdle()
Returns true if thisIExecutor
is ready for action.boolean
Returns true if the current build is likely stuck.
-
Method Details
-
isIdle
boolean isIdle()Returns true if thisIExecutor
is ready for action. -
getOwner
IComputer getOwner()- Returns:
- the
IComputer
that this executor belongs to.
-
getCurrentExecutable
- Returns:
- the current executable, if any.
-
getCurrentWorkUnit
Returns the currentWorkUnit
(ofthe current executable
) that this executor is running.- Returns:
- null if the executor is idle.
-
getDisplayName
String getDisplayName()- Returns:
- the current display name of the executor. Usually the name of the executable.
-
getParentTask
- Returns:
- a reference to the parent task of the current executable, if any.
-
hasStopPermission
boolean hasStopPermission()Checks if the current user has a permission to stop this build. -
getNumber
int getNumber()Gets the executor number that uniquely identifies it among otherIExecutor
s for the same computer.- Returns:
- a sequential number starting from 0.
-
getElapsedTime
long getElapsedTime()Gets the elapsed time since the build has started.- Returns:
- the number of milliseconds since the build has started.
-
getTimestampString
Gets the string that says how long since this build has started.- Returns:
- string like "3 minutes" "1 day" etc.
-
getEstimatedRemainingTime
String getEstimatedRemainingTime()Computes a human-readable text that shows the expected remaining time until the build completes. -
isLikelyStuck
boolean isLikelyStuck()Returns true if the current build is likely stuck.This is a heuristics based approach, but if the build is suspiciously taking for a long time, this method returns true.
-
getProgress
int getProgress()Returns the progress of the current build in the number between 0-100.- Returns:
- -1 if it's impossible to estimate the progress.
-