Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Darwin meminfo metrics have been renamed to match Prometheus conventions. #1060
* [BUGFIX] Handle vanishing PIDs #1043
* [BUGFIX] Correctly cast Darwin memory info #1060
* [BUGFIX] Filter systemd units in Go for compatibility with older versions #1083
* [BUGFIX] Update cpu collector for OpenBSD 6.4

## 0.16.0 / 2018-05-15

Expand Down
6 changes: 4 additions & 2 deletions collector/cpu_openbsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ func (c *cpuCollector) Update(ch chan<- prometheus.Metric) (err error) {
var cp_time [][C.CPUSTATES]C.int64_t
for i := 0; i < int(ncpus); i++ {
cp_timeb, err := unix.SysctlRaw("kern.cp_time2", i)
if err != nil {
if err != nil && err != unix.ENODEV {
return err
}
cp_time = append(cp_time, *(*[C.CPUSTATES]C.int64_t)(unsafe.Pointer(&cp_timeb[0])))
if err != unix.ENODEV {
cp_time = append(cp_time, *(*[C.CPUSTATES]C.int64_t)(unsafe.Pointer(&cp_timeb[0])))
}
}

for cpu, time := range cp_time {
Expand Down