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
This commit is contained in:
colmbuckley 2018-03-07 21:56:57 +11:00 committed by Ben Kochie
parent 84719ef59a
commit 098f975b48
1 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@ import (
/* /*
#cgo LDFLAGS: #cgo LDFLAGS:
#include <stdlib.h> #include <stdlib.h>
#include <limits.h>
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <mach/mach_init.h> #include <mach/mach_init.h>
@ -45,7 +46,7 @@ import (
import "C" import "C"
// ClocksPerSec default value. from time.h // ClocksPerSec default value. from time.h
const ClocksPerSec = float64(128) const ClocksPerSec = float64(C.CLK_TCK)
type statCollector struct { type statCollector struct {
cpu *prometheus.Desc cpu *prometheus.Desc