-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from ahormazabal/dev/execution_query_metrics
support for execution metrics API
- Loading branch information
Showing
8 changed files
with
432 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
rd-api-client/src/main/java/org/rundeck/client/api/model/executions/MetricsResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package org.rundeck.client.api.model.executions; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Data; | ||
import org.rundeck.client.util.DataOutput; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@Data | ||
public class MetricsResponse | ||
implements DataOutput | ||
{ | ||
private Long total; | ||
private Status status; | ||
private Map<String, String> duration; | ||
|
||
@Override | ||
public Map<?, ?> asMap() { | ||
HashMap<String, Object> data = new HashMap<>(); | ||
data.put("total", total); | ||
data.put("status", status); | ||
data.put("duration", duration); | ||
return data; | ||
} | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@Data | ||
public static class Status | ||
implements DataOutput | ||
{ | ||
private Long succeeded; | ||
private Long failed; | ||
@JsonProperty("failed-with-retry") | ||
private Long failedWithRetry; | ||
private Long aborted; | ||
private Long running; | ||
private Long other; | ||
private Long timedout; | ||
private Long scheduled; | ||
|
||
@Override | ||
public Map<?, ?> asMap() { | ||
HashMap<String, Object> data = new HashMap<>(); | ||
if (null != succeeded) { | ||
data.put("succeeded", succeeded); | ||
} | ||
if (null != failed) { | ||
data.put("failed", failed); | ||
} | ||
if (null != failedWithRetry) { | ||
data.put("failed-with-retry", failedWithRetry); | ||
} | ||
if (null != aborted) { | ||
data.put("aborted", aborted); | ||
} | ||
if (null != running) { | ||
data.put("running", running); | ||
} | ||
if (null != other) { | ||
data.put("other", other); | ||
} | ||
if (null != timedout) { | ||
data.put("timedout", timedout); | ||
} | ||
if (null != scheduled) { | ||
data.put("scheduled", scheduled); | ||
} | ||
return data; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.