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:
parent
84719ef59a
commit
098f975b48
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue