Fix a couple imports and a float comparison test
This commit is contained in:
parent
ba96ae78dd
commit
941c9acabf
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue