From 78c84b1a4737bc5b43096d9fd7f4078ba37e0e77 Mon Sep 17 00:00:00 2001 From: stuart nelson Date: Mon, 19 Sep 2016 09:48:34 +0200 Subject: [PATCH] Remove old freq finding code This is the code that was lifted from the freebsd implementation, but was not correct. --- collector/cpu_dragonfly.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/collector/cpu_dragonfly.go b/collector/cpu_dragonfly.go index b1a9785f..173f4fa4 100644 --- a/collector/cpu_dragonfly.go +++ b/collector/cpu_dragonfly.go @@ -32,23 +32,6 @@ import ( #include #include -static int mibs_set_up = 0; - -static int mib_kern_cp_times[2]; -static size_t mib_kern_cp_times_len = 2; - -static const int mib_kern_clockrate[] = {CTL_KERN, KERN_CLOCKRATE}; -static size_t mib_kern_clockrate_len = 2; - -// Setup method for MIBs not available as constants. -// Calls to this method must be synchronized externally. -int -setupSysctlMIBs() { - int ret = sysctlnametomib("kern.cputime", mib_kern_cp_times, &mib_kern_cp_times_len); - if (ret == 0) mibs_set_up = 1; - return ret; -} - int getCPUTimes(char **cputime) { size_t len; @@ -117,9 +100,6 @@ func init() { // Takes a prometheus registry and returns a new Collector exposing // CPU stats. func NewStatCollector() (Collector, error) { - if C.setupSysctlMIBs() == -1 { - return nil, errors.New("could not initialize sysctl MIBs") - } return &statCollector{ cpu: prometheus.NewDesc( prometheus.BuildFQName(Namespace, "", "cpu"),