Skip to content

Commit

Permalink
Correct the ClocksPerSec scaling factor on Darwin (#846)
Browse files Browse the repository at this point in the history
* Update cpu_darwin.go

Change the definition of ClocksPerSec to read from limits.h

* Update cpu_darwin.go
  • Loading branch information
colmbuckley authored and SuperQ committed Mar 7, 2018
1 parent 84719ef commit 098f975
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion collector/cpu_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
/*
#cgo LDFLAGS:
#include <stdlib.h>
#include <limits.h>
#include <sys/sysctl.h>
#include <sys/mount.h>
#include <mach/mach_init.h>
Expand All @@ -45,7 +46,7 @@ import (
import "C"

// ClocksPerSec default value. from time.h
const ClocksPerSec = float64(128)
const ClocksPerSec = float64(C.CLK_TCK)

type statCollector struct {
cpu *prometheus.Desc
Expand Down

0 comments on commit 098f975

Please sign in to comment.