forked from jenkinsci/pipeline-graph-view-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractPipelineNode.java
More file actions
63 lines (51 loc) · 1.58 KB
/
AbstractPipelineNode.java
File metadata and controls
63 lines (51 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package io.jenkins.plugins.pipelinegraphview.utils;
import io.jenkins.plugins.pipelinegraphview.analysis.TimingInfo;
public class AbstractPipelineNode {
private String name;
private PipelineState state;
private String type; // TODO enum
private String title;
private String id;
private long pauseDurationMillis;
private long totalDurationMillis;
private TimingInfo timingInfo;
public AbstractPipelineNode(
String id, String name, PipelineState state, String type, String title, TimingInfo timingInfo) {
this.id = id;
this.name = name;
this.state = state;
this.type = type;
this.title = title;
this.timingInfo = timingInfo;
// These values won't change for a given TimingInfo.
this.pauseDurationMillis = timingInfo.getPauseDurationMillis();
this.totalDurationMillis = timingInfo.getTotalDurationMillis();
}
public long getPauseDurationMillis() {
return pauseDurationMillis;
}
public long getStartTimeMillis() {
return timingInfo.getStartTimeMillis();
}
public Long getTotalDurationMillis() {
return state == PipelineState.RUNNING ? null : totalDurationMillis;
}
public String getId() {
return id;
}
public String getName() {
return name;
}
public PipelineState getState() {
return state;
}
public String getType() {
return type;
}
public String getTitle() {
return title;
}
protected TimingInfo getTimingInfo() {
return this.timingInfo;
}
}