Use cgroups proto for prom metrics

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-09-05 13:05:54 -04:00
parent 0973a084cf
commit ed45952826
9 changed files with 92 additions and 82 deletions

View File

@@ -16,7 +16,7 @@ var cpuMetrics = []*metric{
help: "The total cpu time",
unit: metrics.Nanoseconds,
vt: prometheus.GaugeValue,
getValues: func(stats *cgroups.Stats) []value {
getValues: func(stats *cgroups.Metrics) []value {
if stats.Cpu == nil {
return nil
}
@@ -32,7 +32,7 @@ var cpuMetrics = []*metric{
help: "The total kernel cpu time",
unit: metrics.Nanoseconds,
vt: prometheus.GaugeValue,
getValues: func(stats *cgroups.Stats) []value {
getValues: func(stats *cgroups.Metrics) []value {
if stats.Cpu == nil {
return nil
}
@@ -48,7 +48,7 @@ var cpuMetrics = []*metric{
help: "The total user cpu time",
unit: metrics.Nanoseconds,
vt: prometheus.GaugeValue,
getValues: func(stats *cgroups.Stats) []value {
getValues: func(stats *cgroups.Metrics) []value {
if stats.Cpu == nil {
return nil
}
@@ -65,7 +65,7 @@ var cpuMetrics = []*metric{
unit: metrics.Nanoseconds,
vt: prometheus.GaugeValue,
labels: []string{"cpu"},
getValues: func(stats *cgroups.Stats) []value {
getValues: func(stats *cgroups.Metrics) []value {
if stats.Cpu == nil {
return nil
}
@@ -84,7 +84,7 @@ var cpuMetrics = []*metric{
help: "The total cpu throttle periods",
unit: metrics.Total,
vt: prometheus.GaugeValue,
getValues: func(stats *cgroups.Stats) []value {
getValues: func(stats *cgroups.Metrics) []value {
if stats.Cpu == nil {
return nil
}
@@ -100,7 +100,7 @@ var cpuMetrics = []*metric{
help: "The total cpu throttled periods",
unit: metrics.Total,
vt: prometheus.GaugeValue,
getValues: func(stats *cgroups.Stats) []value {
getValues: func(stats *cgroups.Metrics) []value {
if stats.Cpu == nil {
return nil
}
@@ -116,7 +116,7 @@ var cpuMetrics = []*metric{
help: "The total cpu throttled time",
unit: metrics.Nanoseconds,
vt: prometheus.GaugeValue,
getValues: func(stats *cgroups.Stats) []value {
getValues: func(stats *cgroups.Metrics) []value {
if stats.Cpu == nil {
return nil
}