Unverified Commit 3407ec95 authored by Timo Pawelka's avatar Timo Pawelka Committed by GitHub
Browse files

Added `queued_duration` for Pipelines and Jobs (#930)

* Added hook and fetch capabilities

* Fix tests

* Remove superfluous formatting
parent 37503e0c
...@@ -29,6 +29,7 @@ public class Job { ...@@ -29,6 +29,7 @@ public class Job {
private Boolean manual; private Boolean manual;
private Boolean allowFailure; private Boolean allowFailure;
private Float duration; private Float duration;
private Float queuedDuration;
private Project project; private Project project;
public Long getId() { public Long getId() {
...@@ -206,11 +207,18 @@ public class Job { ...@@ -206,11 +207,18 @@ public class Job {
public void setDuration(Float duration) { public void setDuration(Float duration) {
this.duration = duration; this.duration = duration;
} }
public Float getQueuedDuration() {
return queuedDuration;
}
public void setQueuedDuration(Float queuedDuration) {
this.queuedDuration = queuedDuration;
}
public Project getProject() { public Project getProject() {
return project; return project;
} }
public void setProject(Project project) { public void setProject(Project project) {
this.project = project; this.project = project;
} }
...@@ -304,12 +312,16 @@ public class Job { ...@@ -304,12 +312,16 @@ public class Job {
this.allowFailure = allowFailure; this.allowFailure = allowFailure;
return this; return this;
} }
public Job withDuration(Float duration) { public Job withDuration(Float duration) {
this.duration = duration; this.duration = duration;
return this; return this;
} }
public Job withQueuedDuration(Float queuedDuration) {
this.queuedDuration = queuedDuration;
return this;
}
public Job withProject(Project project) { public Job withProject(Project project) {
this.project = project; this.project = project;
return this; return this;
......
...@@ -22,6 +22,7 @@ public class Pipeline { ...@@ -22,6 +22,7 @@ public class Pipeline {
private Date committedAt; private Date committedAt;
private String coverage; private String coverage;
private Integer duration; private Integer duration;
private Float queuedDuration;
private String webUrl; private String webUrl;
private DetailedStatus detailedStatus; private DetailedStatus detailedStatus;
...@@ -225,6 +226,14 @@ public class Pipeline { ...@@ -225,6 +226,14 @@ public class Pipeline {
this.duration = duration; this.duration = duration;
} }
public Float getQueuedDuration() {
return queuedDuration;
}
public void setQueuedDuration(Float queuedDuration) {
this.queuedDuration = queuedDuration;
}
public String getWebUrl() { public String getWebUrl() {
return webUrl; return webUrl;
} }
......
...@@ -81,6 +81,7 @@ public class PipelineEvent extends AbstractEvent { ...@@ -81,6 +81,7 @@ public class PipelineEvent extends AbstractEvent {
private Date createdAt; private Date createdAt;
private Date finishedAt; private Date finishedAt;
private Integer duration; private Integer duration;
private Float queuedDuration;
private List<Variable> variables; private List<Variable> variables;
public Long getId() { public Long getId() {
...@@ -171,6 +172,14 @@ public class PipelineEvent extends AbstractEvent { ...@@ -171,6 +172,14 @@ public class PipelineEvent extends AbstractEvent {
this.duration = duration; this.duration = duration;
} }
public Float getQueuedDuration() {
return queuedDuration;
}
public void setQueuedDuration(Float queuedDuration) {
this.queuedDuration = queuedDuration;
}
public List<Variable> getVariables() { public List<Variable> getVariables() {
return variables; return variables;
} }
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
"web_url": "https://example.com/foo/bar/-/jobs/7", "web_url": "https://example.com/foo/bar/-/jobs/7",
"allow_failure": false, "allow_failure": false,
"duration": 0.465, "duration": 0.465,
"queued_duration": 0.010,
"user": { "user": {
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
"created_at": "2015-12-21T13:14:24.077Z", "created_at": "2015-12-21T13:14:24.077Z",
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
"created_at": "2016-08-12T15:23:28Z", "created_at": "2016-08-12T15:23:28Z",
"finished_at": "2016-08-12T15:26:29Z", "finished_at": "2016-08-12T15:26:29Z",
"duration": 63, "duration": 63,
"queued_duration": 0.010,
"variables": [ "variables": [
{ {
"key": "NESTOR_PROD_ENVIRONMENT", "key": "NESTOR_PROD_ENVIRONMENT",
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
"updated_at": "2016-08-11T11:32:35.169Z", "updated_at": "2016-08-11T11:32:35.169Z",
"finished_at": "2016-08-11T11:32:35.145Z", "finished_at": "2016-08-11T11:32:35.145Z",
"coverage": "30.0", "coverage": "30.0",
"queued_duration": 0.010,
"detailed_status": { "detailed_status": {
"icon": "status_pending", "icon": "status_pending",
"text": "pending", "text": "pending",
...@@ -28,4 +29,4 @@ ...@@ -28,4 +29,4 @@
"details_path": "/gitlab4j/test-project/pipelines/66", "details_path": "/gitlab4j/test-project/pipelines/66",
"favicon": "/assets/ci_favicons/favicon_status_pending-5bdf338420e5221ca24353b6bff1c9367189588750632e9a871b7af09ff6a2ae.png" "favicon": "/assets/ci_favicons/favicon_status_pending-5bdf338420e5221ca24353b6bff1c9367189588750632e9a871b7af09ff6a2ae.png"
} }
} }
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment