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.longGets the elapsed time since the build has started.Computes a human-readable text that shows the expected remaining time until the build completes.intGets the executor number that uniquely identifies it among otherIExecutors for the same computer.getOwner()default ITaskintReturns the progress of the current build in the number between 0-100.default StringGets the string that says how long since this build has started.booleanChecks if the current user has a permission to stop this build.booleanisIdle()Returns true if thisIExecutoris ready for action.booleanReturns true if the current build is likely stuck.
-
Method Details
-
isIdle
boolean isIdle()Returns true if thisIExecutoris ready for action. -
getOwner
IComputer getOwner()- Returns:
- the
IComputerthat 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 otherIExecutors 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.
-