Added CPU Usage details to statsd (#1393)

* Added CPU Usage details to statsd

* Fixed bad path to load average

* Fixed some issues with formatting and types. This is now tested

* Updated to make load average follow the same schema as other cpu metrics
This commit is contained in:
Brent Hughes 2016-08-01 19:01:10 -05:00 committed by Tim St. Clair
parent a40e0923a0
commit e9f8dd31bb

View File

@ -31,6 +31,12 @@ type statsdStorage struct {
const (
colCpuCumulativeUsage string = "cpu_cumulative_usage"
// CPU system
colCpuUsageSystem string = "cpu_usage_system"
// CPU user
colCpuUsageUser string = "cpu_usage_user"
// CPU average load
colCpuLoadAverage string = "cpu_load_average"
// Memory Usage
colMemoryUsage string = "memory_usage"
// Working set size
@ -63,6 +69,11 @@ func (self *statsdStorage) containerStatsToValues(
// Cumulative Cpu Usage
series[colCpuCumulativeUsage] = stats.Cpu.Usage.Total
// Cpu usage
series[colCpuUsageSystem] = stats.Cpu.Usage.System
series[colCpuUsageUser] = stats.Cpu.Usage.User
series[colCpuLoadAverage] = uint64(stats.Cpu.LoadAverage)
// Memory Usage
series[colMemoryUsage] = stats.Memory.Usage