From 941c9acabf194c15a0ca2ff5ba5fb14d6cdd6cca Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Mon, 6 Apr 2015 16:22:34 -0700 Subject: [PATCH] Fix a couple imports and a float comparison test --- plugins/system/ps/cpu/cpu_test.go | 2 +- plugins/system/ps/docker/docker_linux.go | 4 ++-- plugins/system/ps/net/net_linux.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/system/ps/cpu/cpu_test.go b/plugins/system/ps/cpu/cpu_test.go index 7de17a767..b1cffb543 100644 --- a/plugins/system/ps/cpu/cpu_test.go +++ b/plugins/system/ps/cpu/cpu_test.go @@ -82,7 +82,7 @@ func testCPUPercent(t *testing.T, percpu bool) { t.Errorf("error %v", err) } for _, percent := range v { - if percent < 0.0 || percent > 100.0*float64(numcpu) { + if percent < 0.0 || int(percent) > 100*numcpu { t.Fatalf("CPUPercent value is invalid: %f", percent) } } diff --git a/plugins/system/ps/docker/docker_linux.go b/plugins/system/ps/docker/docker_linux.go index 3dd1cdfcb..aee9aa35c 100644 --- a/plugins/system/ps/docker/docker_linux.go +++ b/plugins/system/ps/docker/docker_linux.go @@ -9,8 +9,8 @@ import ( "strconv" "strings" - common "github.com/shirou/gopsutil/common" - cpu "github.com/shirou/gopsutil/cpu" + "github.com/influxdb/tivan/plugins/system/ps/common" + "github.com/influxdb/tivan/plugins/system/ps/cpu" ) // GetDockerIDList returnes a list of DockerID. diff --git a/plugins/system/ps/net/net_linux.go b/plugins/system/ps/net/net_linux.go index 9184439a4..7535495e5 100644 --- a/plugins/system/ps/net/net_linux.go +++ b/plugins/system/ps/net/net_linux.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - common "github.com/shirou/gopsutil/common" + common "github.com/influxdb/tivan/plugins/system/ps/common" ) // NetIOCounters returnes network I/O statistics for every network