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 Details

    • isIdle

      boolean isIdle()
      Returns true if this IExecutor is ready for action.
    • getOwner

      IComputer getOwner()
      Returns:
      the IComputer that this executor belongs to.
    • getCurrentExecutable

      @CheckForNull Queue.Executable getCurrentExecutable()
      Returns:
      the current executable, if any.
    • getCurrentWorkUnit

      @CheckForNull WorkUnit getCurrentWorkUnit()
      Returns the current WorkUnit (of the 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

      @CheckForNull default ITask 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 other IExecutors 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

      default String 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.