From 4ead971d707d4757fbb152eea87a317e3359d291 Mon Sep 17 00:00:00 2001 From: Shirou WAKAYAMA Date: Fri, 13 Feb 2015 23:14:36 +0900 Subject: [PATCH] fix CPUTimes type change problem on other packages. --- docker/docker_linux.go | 8 ++++---- process/process_linux.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docker/docker_linux.go b/docker/docker_linux.go index 25470b1..c8e19fc 100644 --- a/docker/docker_linux.go +++ b/docker/docker_linux.go @@ -83,15 +83,15 @@ func CgroupCPU(containerid string, base string) (*cpu.CPUTimesStat, error) { for _, line := range lines { fields := strings.Split(line, " ") if fields[0] == "user" { - user, err := strconv.ParseFloat(fields[1], 32) + user, err := strconv.ParseFloat(fields[1], 64) if err == nil { - ret.User = float32(user) + ret.User = float64(user) } } if fields[0] == "system" { - system, err := strconv.ParseFloat(fields[1], 32) + system, err := strconv.ParseFloat(fields[1], 64) if err == nil { - ret.System = float32(system) + ret.System = float64(system) } } } diff --git a/process/process_linux.go b/process/process_linux.go index e4b45b3..855761d 100644 --- a/process/process_linux.go +++ b/process/process_linux.go @@ -552,8 +552,8 @@ func (p *Process) fillFromStat() (string, int32, *cpu.CPUTimesStat, int64, int32 cpuTimes := &cpu.CPUTimesStat{ CPU: "cpu", - User: float32(utime * (1000 / ClockTicks)), - System: float32(stime * (1000 / ClockTicks)), + User: float64(utime * (1000 / ClockTicks)), + System: float64(stime * (1000 / ClockTicks)), } bootTime, _ := host.BootTime()