Skip to content

Commit e824cde

Browse files
rexagodSuperQ
authored andcommitted
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 <[email protected]>
1 parent 2d4cb7a commit e824cde

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

collector/cpu_solaris.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,17 @@ func (c *cpuCollector) Update(ch chan<- prometheus.Metric) error {
6060
}
6161

6262
for k, v := range map[string]string{
63-
"idle": "cpu_ticks_idle",
64-
"kernel": "cpu_ticks_kernel",
65-
"user": "cpu_ticks_user",
66-
"wait": "cpu_ticks_wait",
63+
"idle": "cpu_nsec_idle",
64+
"kernel": "cpu_nsec_kernel",
65+
"user": "cpu_nsec_user",
66+
"wait": "cpu_nsec_wait",
6767
} {
6868
kstatValue, err := ksCPU.GetNamed(v)
6969
if err != nil {
7070
return err
7171
}
7272

73-
ch <- c.cpu.mustNewConstMetric(float64(kstatValue.UintVal), strconv.Itoa(cpu), k)
73+
ch <- c.cpu.mustNewConstMetric(float64(kstatValue.UintVal)/1e9, strconv.Itoa(cpu), k)
7474
}
7575
}
7676
return nil

0 commit comments

Comments
 (0)