This repository was archived by the owner on Dec 1, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Heapster exports the following metrics to its backends.
1212| cpu/request | CPU request (the guaranteed amount of resources) in millicores. |
1313| cpu/usage | Cumulative CPU usage on all cores. |
1414| cpu/usage_rate | CPU usage on all cores in millicores. |
15+ | cpu/load | CPU load in milliloads, i.e., runnable threads * 1000 |
1516| filesystem/usage | Total number of bytes consumed on a filesystem. |
1617| filesystem/limit | The total size of filesystem in bytes. |
1718| filesystem/available | The number of available bytes remaining in a the filesystem |
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ const (
2929var StandardMetrics = []Metric {
3030 MetricUptime ,
3131 MetricCpuUsage ,
32+ MetricCpuLoad ,
3233 MetricEphemeralStorageUsage ,
3334 MetricMemoryUsage ,
3435 MetricMemoryRSS ,
@@ -101,6 +102,7 @@ var CpuMetrics = []Metric{
101102 MetricCpuLimit ,
102103 MetricCpuRequest ,
103104 MetricCpuUsage ,
105+ MetricCpuLoad ,
104106 MetricCpuUsageRate ,
105107 MetricNodeCpuAllocatable ,
106108 MetricNodeCpuCapacity ,
@@ -202,6 +204,25 @@ var MetricRestartCount = Metric{
202204 },
203205}
204206
207+ var MetricCpuLoad = Metric {
208+ MetricDescriptor : MetricDescriptor {
209+ Name : "cpu/load" ,
210+ Description : "CPU load" ,
211+ Type : MetricGauge ,
212+ ValueType : ValueInt64 ,
213+ Units : UnitsCount ,
214+ },
215+ HasValue : func (spec * cadvisor.ContainerSpec ) bool {
216+ return spec .HasCpu
217+ },
218+ GetValue : func (spec * cadvisor.ContainerSpec , stat * cadvisor.ContainerStats ) MetricValue {
219+ return MetricValue {
220+ ValueType : ValueInt64 ,
221+ MetricType : MetricGauge ,
222+ IntValue : int64 (stat .Cpu .LoadAverage )}
223+ },
224+ }
225+
205226var MetricCpuUsage = Metric {
206227 MetricDescriptor : MetricDescriptor {
207228 Name : "cpu/usage" ,
You can’t perform that action at this time.
0 commit comments