mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-25 05:34:10 -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{
|
||||
"idle": "cpu_ticks_idle",
|
||||
"kernel": "cpu_ticks_kernel",
|
||||
"user": "cpu_ticks_user",
|
||||
"wait": "cpu_ticks_wait",
|
||||
"idle": "cpu_nsec_idle",
|
||||
"kernel": "cpu_nsec_kernel",
|
||||
"user": "cpu_nsec_user",
|
||||
"wait": "cpu_nsec_wait",
|
||||
} {
|
||||
kstatValue, err := ksCPU.GetNamed(v)
|
||||
if err != nil {
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue