Skip to content

Commit 995d81f

Browse files
authored
Merge pull request docker-java#724 from freva/getter-for-previous-cpu-stats
Added getter for previous cpu stats
2 parents a40fcff + 80ba61f commit 995d81f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/main/java/com/github/dockerjava/api/model/Statistics.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public class Statistics implements Serializable {
4646
@JsonProperty("cpu_stats")
4747
private Map<String, Object> cpuStats;
4848

49+
/**
50+
* @since Docker Remote API 1.19
51+
*/
52+
@JsonProperty("precpu_stats")
53+
private Map<String, Object> preCpuStats;
54+
4955
/**
5056
* @since Docker Remote API 1.21
5157
*/
@@ -66,6 +72,14 @@ public Map<String, Object> getCpuStats() {
6672
return cpuStats;
6773
}
6874

75+
/**
76+
* The cpu statistic of last read, which is used for calculating the cpu usage percent.
77+
* It is not the exact copy of the {@link #getCpuStats()}.
78+
*/
79+
public Map<String, Object> getPreCpuStats() {
80+
return preCpuStats;
81+
}
82+
6983
public Map<String, Object> getMemoryStats() {
7084
return memoryStats;
7185
}

0 commit comments

Comments
 (0)