diff options
Diffstat (limited to 'devices/cpu.go')
-rw-r--r-- | devices/cpu.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/devices/cpu.go b/devices/cpu.go index 21d21b6..436ccb1 100644 --- a/devices/cpu.go +++ b/devices/cpu.go @@ -5,7 +5,7 @@ import ( "time" ) -var cpuFuncs []func(map[string]float64, time.Duration, bool) map[string]error +var cpuFuncs []func(map[string]int, time.Duration, bool) map[string]error // RegisterCPU adds a new CPU device to the CPU widget. labels returns the // names of the devices; they should be as short as possible, and the indexes @@ -16,13 +16,13 @@ var cpuFuncs []func(map[string]float64, time.Duration, bool) map[string]error // // labels may be called once and the value cached. This means the number of // cores should not change dynamically. -func RegisterCPU(f func(map[string]float64, time.Duration, bool) map[string]error) { +func RegisterCPU(f func(map[string]int, time.Duration, bool) map[string]error) { cpuFuncs = append(cpuFuncs, f) } // CPUPercent calculates the percentage of cpu used either per CPU or combined. // Returns one value per cpu, or a single value if percpu is set to false. -func UpdateCPU(cpus map[string]float64, interval time.Duration, logical bool) { +func UpdateCPU(cpus map[string]int, interval time.Duration, logical bool) { for _, f := range cpuFuncs { errs := f(cpus, interval, logical) if errs != nil { |