public class StatusAndTiming extends Object
FlowNodes in the same FlowExecution with a first and last node.
Chunks exist in a context: the FlowNode before and the FlowNode after. These follow common-sense rules:
FlowStartNode for that executionFlowEndNode for that executionWorkflowRun is a parameter, it and the FlowNodes must all belong to the same execution| Constructor and Description |
|---|
StatusAndTiming() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,GenericStatus> |
computeBranchStatuses(org.jenkinsci.plugins.workflow.job.WorkflowRun run,
org.jenkinsci.plugins.workflow.graph.FlowNode parallelStart,
List<org.jenkinsci.plugins.workflow.graph.BlockStartNode> branchStarts,
List<org.jenkinsci.plugins.workflow.graph.FlowNode> branchEnds,
org.jenkinsci.plugins.workflow.graph.FlowNode parallelEnd)
Compute status codes for a set of parallel branches.
|
static Map<String,GenericStatus> |
computeBranchStatuses(org.jenkinsci.plugins.workflow.job.WorkflowRun run,
org.jenkinsci.plugins.workflow.graphanalysis.ParallelMemoryFlowChunk parallel) |
static GenericStatus |
computeChunkStatus(org.jenkinsci.plugins.workflow.job.WorkflowRun run,
org.jenkinsci.plugins.workflow.graph.FlowNode before,
org.jenkinsci.plugins.workflow.graph.FlowNode firstNode,
org.jenkinsci.plugins.workflow.graph.FlowNode lastNode,
org.jenkinsci.plugins.workflow.graph.FlowNode after)
Compute the overall status for a chunk comprising firstNode through lastNode, inclusive
All nodes must be in the same execution
Note: for in-progress builds with parallel branches, if the branch is done, it has its own status.
|
static GenericStatus |
computeChunkStatus(org.jenkinsci.plugins.workflow.job.WorkflowRun run,
org.jenkinsci.plugins.workflow.graphanalysis.MemoryFlowChunk chunk)
Return status or null if not executed all (null FlowExecution)
|
static TimingInfo |
computeChunkTiming(org.jenkinsci.plugins.workflow.job.WorkflowRun run,
long internalPauseDuration,
org.jenkinsci.plugins.workflow.graph.FlowNode firstNode,
org.jenkinsci.plugins.workflow.graph.FlowNode lastNode,
org.jenkinsci.plugins.workflow.graph.FlowNode after)
Compute timing for a chunk of nodes
Note: for in-progress builds with parallel branches, the running branches end at the current time.
|
static TimingInfo |
computeChunkTiming(org.jenkinsci.plugins.workflow.job.WorkflowRun run,
long internalPauseDuration,
org.jenkinsci.plugins.workflow.graphanalysis.MemoryFlowChunk chunk) |
static TimingInfo |
computeOverallParallelTiming(org.jenkinsci.plugins.workflow.job.WorkflowRun run,
Map<String,TimingInfo> branchTimings,
org.jenkinsci.plugins.workflow.graph.FlowNode parallelStart,
org.jenkinsci.plugins.workflow.graph.FlowNode parallelEnd)
Computes the branch timings for a set of parallel branches.
|
static Map<String,TimingInfo> |
computeParallelBranchTimings(org.jenkinsci.plugins.workflow.job.WorkflowRun run,
org.jenkinsci.plugins.workflow.graph.FlowNode parallelStart,
List<org.jenkinsci.plugins.workflow.graph.BlockStartNode> branchStarts,
List<org.jenkinsci.plugins.workflow.graph.FlowNode> branchEnds,
org.jenkinsci.plugins.workflow.graph.FlowNode parallelEnd,
long[] pauseDurations)
Compute timing for all branches of a parallel
|
static GenericStatus |
condenseStatus(Collection<GenericStatus> statuses)
Combines the status results from a list of parallel branches to report a single overall status
|
static boolean |
isPendingInput(org.jenkinsci.plugins.workflow.job.WorkflowRun run)
Return true if the run is paused on input
|
static void |
printNodes(org.jenkinsci.plugins.workflow.job.WorkflowRun run,
boolean showTiming,
boolean showActions)
Helper, prints flow graph in some detail - now a common utility so others don't have to reinvent it
|
static void |
verifySameRun(org.jenkinsci.plugins.workflow.job.WorkflowRun run,
org.jenkinsci.plugins.workflow.graph.FlowNode... nodes)
Check that all the flownodes & run describe the same pipeline run/execution
|
public static void verifySameRun(@Nonnull org.jenkinsci.plugins.workflow.job.WorkflowRun run, @CheckForNull org.jenkinsci.plugins.workflow.graph.FlowNode... nodes) throws IllegalArgumentException
run - Run that nodes must belong tonodes - Nodes to match to runIllegalArgumentException - For the first flownode that doesn't belong to the FlowExectuon of runpublic static boolean isPendingInput(org.jenkinsci.plugins.workflow.job.WorkflowRun run)
@CheckForNull public static GenericStatus computeChunkStatus(@Nonnull org.jenkinsci.plugins.workflow.job.WorkflowRun run, @Nonnull org.jenkinsci.plugins.workflow.graphanalysis.MemoryFlowChunk chunk)
@CheckForNull public static GenericStatus computeChunkStatus(@Nonnull org.jenkinsci.plugins.workflow.job.WorkflowRun run, @CheckForNull org.jenkinsci.plugins.workflow.graph.FlowNode before, @Nonnull org.jenkinsci.plugins.workflow.graph.FlowNode firstNode, @Nonnull org.jenkinsci.plugins.workflow.graph.FlowNode lastNode, @CheckForNull org.jenkinsci.plugins.workflow.graph.FlowNode after)
run - Run that nodes belong tobefore - Node before the first node in this piecefirstNode - First node of this piecelastNode - Last node of this piece (if lastNode==firstNode, it's a single FlowNode)after - Node after this piece, null if the lastNode is the currentHead of the flow@CheckForNull public static TimingInfo computeChunkTiming(@Nonnull org.jenkinsci.plugins.workflow.job.WorkflowRun run, long internalPauseDuration, @Nonnull org.jenkinsci.plugins.workflow.graphanalysis.MemoryFlowChunk chunk)
@CheckForNull public static TimingInfo computeChunkTiming(@Nonnull org.jenkinsci.plugins.workflow.job.WorkflowRun run, long internalPauseDuration, @Nonnull org.jenkinsci.plugins.workflow.graph.FlowNode firstNode, @Nonnull org.jenkinsci.plugins.workflow.graph.FlowNode lastNode, @CheckForNull org.jenkinsci.plugins.workflow.graph.FlowNode after)
BlockEndNode terminating the branch was created.run - WorkflowRun they all belong tointernalPauseDuration - Millis paused in the chunk (including the ends)firstNode - First node in the chunklastNode - Last node in the chunkafter - Node after the chunk, if null we assume this chunk is at the end of the flow@CheckForNull public static TimingInfo computeOverallParallelTiming(@Nonnull org.jenkinsci.plugins.workflow.job.WorkflowRun run, @Nonnull Map<String,TimingInfo> branchTimings, @Nonnull org.jenkinsci.plugins.workflow.graph.FlowNode parallelStart, @CheckForNull org.jenkinsci.plugins.workflow.graph.FlowNode parallelEnd)
run - branchTimings - Map of branch name : precomputed timing infoparallelStart - parallelEnd - @Nonnull public static Map<String,TimingInfo> computeParallelBranchTimings(@Nonnull org.jenkinsci.plugins.workflow.job.WorkflowRun run, @Nonnull org.jenkinsci.plugins.workflow.graph.FlowNode parallelStart, @Nonnull List<org.jenkinsci.plugins.workflow.graph.BlockStartNode> branchStarts, @Nonnull List<org.jenkinsci.plugins.workflow.graph.FlowNode> branchEnds, @CheckForNull org.jenkinsci.plugins.workflow.graph.FlowNode parallelEnd, @Nonnull long[] pauseDurations)
run - Run the branches belong toparallelStart - Start of parallel blockbranchStarts - Nodes that begin each parallel branchbranchEnds - Nodes that represent the "tip" of each parallel branch (may be the end node, or just the latest)parallelEnd - End of parallel block (null if in progress)pauseDurations - Accumulated pause durations for each of the branches, in order@Nonnull public static Map<String,GenericStatus> computeBranchStatuses(@Nonnull org.jenkinsci.plugins.workflow.job.WorkflowRun run, @Nonnull org.jenkinsci.plugins.workflow.graphanalysis.ParallelMemoryFlowChunk parallel)
@Nonnull public static Map<String,GenericStatus> computeBranchStatuses(@Nonnull org.jenkinsci.plugins.workflow.job.WorkflowRun run, @Nonnull org.jenkinsci.plugins.workflow.graph.FlowNode parallelStart, @Nonnull List<org.jenkinsci.plugins.workflow.graph.BlockStartNode> branchStarts, @Nonnull List<org.jenkinsci.plugins.workflow.graph.FlowNode> branchEnds, @CheckForNull org.jenkinsci.plugins.workflow.graph.FlowNode parallelEnd)
computeChunkStatus(WorkflowRun, MemoryFlowChunk) for in-progress builds with
parallel branches, if the branch is done, it has its own status.run - Run containing these nodesbranchStarts - The nodes starting off each parallel branch (BlockStartNode)branchEnds - Last node in each parallel branch - might be the end of the branch, or might just be the latest step runparallelStart - Start node for overall parallel blockparallelEnd - End node for the overall parallelBlock (null if not complete)@CheckForNull public static GenericStatus condenseStatus(@Nonnull Collection<GenericStatus> statuses)
@Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) public static void printNodes(@Nonnull org.jenkinsci.plugins.workflow.job.WorkflowRun run, boolean showTiming, boolean showActions)
Copyright © 2016. All rights reserved.