diff options
author | colmbuckley <colm@tuatha.org> | 2018-03-07 21:56:57 +1100 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2018-03-07 11:56:57 +0100 |
commit | 098f975b4875fc065acc377e9e32e04a246a457e (patch) | |
tree | ed1578c022ce81d3264aae50cef54fa699f68378 | |
parent | 84719ef59aef2bdb34619feea03402ba199bf4a3 (diff) | |
download | prometheus_node_collector-098f975b4875fc065acc377e9e32e04a246a457e.tar.bz2 prometheus_node_collector-098f975b4875fc065acc377e9e32e04a246a457e.tar.xz prometheus_node_collector-098f975b4875fc065acc377e9e32e04a246a457e.zip |
Correct the ClocksPerSec scaling factor on Darwin (#846)
* Update cpu_darwin.go
Change the definition of ClocksPerSec to read from limits.h
* Update cpu_darwin.go
-rw-r--r-- | collector/cpu_darwin.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/collector/cpu_darwin.go b/collector/cpu_darwin.go index 7a82e2a..caa59f8 100644 --- a/collector/cpu_darwin.go +++ b/collector/cpu_darwin.go | |||
@@ -31,6 +31,7 @@ import ( | |||
31 | /* | 31 | /* |
32 | #cgo LDFLAGS: | 32 | #cgo LDFLAGS: |
33 | #include <stdlib.h> | 33 | #include <stdlib.h> |
34 | #include <limits.h> | ||
34 | #include <sys/sysctl.h> | 35 | #include <sys/sysctl.h> |
35 | #include <sys/mount.h> | 36 | #include <sys/mount.h> |
36 | #include <mach/mach_init.h> | 37 | #include <mach/mach_init.h> |
@@ -45,7 +46,7 @@ import ( | |||
45 | import "C" | 46 | import "C" |
46 | 47 | ||
47 | // ClocksPerSec default value. from time.h | 48 | // ClocksPerSec default value. from time.h |
48 | const ClocksPerSec = float64(128) | 49 | const ClocksPerSec = float64(C.CLK_TCK) |
49 | 50 | ||
50 | type statCollector struct { | 51 | type statCollector struct { |
51 | cpu *prometheus.Desc | 52 | cpu *prometheus.Desc |