mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-11-09 23:24:09 -08:00
collector/cpu: s/cpu_ticks*/cpu_nsec* for solaris (#2963)
Replace all cpu_ticks_* with cpu_nsec_*, since the former was off my a magnitude of 10e6, and showed incorrect values for node_cpu_seconds_total. Fixes: #1837 Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
This commit is contained in:
parent
2ecbe97066
commit
66fab10db4
|
@ -60,17 +60,17 @@ func (c *cpuCollector) Update(ch chan<- prometheus.Metric) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v := range map[string]string{
|
for k, v := range map[string]string{
|
||||||
"idle": "cpu_ticks_idle",
|
"idle": "cpu_nsec_idle",
|
||||||
"kernel": "cpu_ticks_kernel",
|
"kernel": "cpu_nsec_kernel",
|
||||||
"user": "cpu_ticks_user",
|
"user": "cpu_nsec_user",
|
||||||
"wait": "cpu_ticks_wait",
|
"wait": "cpu_nsec_wait",
|
||||||
} {
|
} {
|
||||||
kstatValue, err := ksCPU.GetNamed(v)
|
kstatValue, err := ksCPU.GetNamed(v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
ch <- c.cpu.mustNewConstMetric(float64(kstatValue.UintVal), strconv.Itoa(cpu), k)
|
ch <- c.cpu.mustNewConstMetric(float64(kstatValue.UintVal)/1e9, strconv.Itoa(cpu), k)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue