From 6215e1bb218a86c217a66e34f2abd043feca8582 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 11 Feb 2020 19:48:23 +0100 Subject: api: fix the CPU stats reported Signed-off-by: Giuseppe Scrivano --- libpod/stats.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libpod/stats.go') diff --git a/libpod/stats.go b/libpod/stats.go index 3b5e0958c..6f42afd18 100644 --- a/libpod/stats.go +++ b/libpod/stats.go @@ -66,7 +66,9 @@ func (c *Container) GetContainerStats(previousStats *ContainerStats) (*Container } stats.BlockInput, stats.BlockOutput = calculateBlockIO(cgroupStats) stats.CPUNano = cgroupStats.CPU.Usage.Total + stats.CPUSystemNano = cgroupStats.CPU.Usage.Kernel stats.SystemNano = now + stats.PerCPU = cgroupStats.CPU.Usage.PerCPU // Handle case where the container is not in a network namespace if netStats != nil { stats.NetInput = netStats.TxBytes -- cgit v1.2.3-54-g00ecf