From cc5142a007c531351f9faf53e79edb6d0b968212 Mon Sep 17 00:00:00 2001 From: stuart nelson Date: Sat, 17 Sep 2016 19:12:48 +0200 Subject: [PATCH] Remove some unnecessary includes --- collector/cpu_dragonfly.go | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/collector/cpu_dragonfly.go b/collector/cpu_dragonfly.go index 615d6355..511468a0 100644 --- a/collector/cpu_dragonfly.go +++ b/collector/cpu_dragonfly.go @@ -26,22 +26,15 @@ import ( /* #cgo LDFLAGS: -#include -#include -#include -#include -#include #include #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_hw_ncpu[] = {CTL_HW, HW_NCPU}; -static const size_t mib_hw_ncpu_len = 2; - static const int mib_kern_clockrate[] = {CTL_KERN, KERN_CLOCKRATE}; static size_t mib_kern_clockrate_len = 2; @@ -145,18 +138,12 @@ func NewStatCollector() (Collector, error) { }, nil } -type exportedCPUTime struct { - cp_user, cp_nice, cp_sys, cp_intr, cp_idle uint64 -} - // Expose CPU stats using sysctl. func (c *statCollector) Update(ch chan<- prometheus.Metric) (err error) { // We want time spent per-cpu per CPUSTATE. // CPUSTATES (number of CPUSTATES) is defined as 5U. - // Order: CP_USER | CP_NICE | CP_SYS | CP_IDLE | CP_INTR - // sysctl kern.cp_times provides hw.ncpu * CPUSTATES long integers: - // hw.ncpu * (space-separated list of the above variables) + // States: CP_USER | CP_NICE | CP_SYS | CP_IDLE | CP_INTR // // Each value is a counter incremented at frequency // kern.clockrate.(stathz | hz)