From 35b63c064ff040727e685fdcc188a99de67136b6 Mon Sep 17 00:00:00 2001 From: Prashant Bhutani Date: Wed, 12 Aug 2020 00:51:20 +0530 Subject: [PATCH] Report correct stats for windows containers Windows container stats were reporting incorrect metrics for cpu kernel runtime. Signed-off-by: Prashant Bhutani --- cmd/ctr/commands/tasks/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ctr/commands/tasks/metrics.go b/cmd/ctr/commands/tasks/metrics.go index 263f183a3..3fd149381 100644 --- a/cmd/ctr/commands/tasks/metrics.go +++ b/cmd/ctr/commands/tasks/metrics.go @@ -176,7 +176,7 @@ func printWindowsContainerStatistics(w *tabwriter.Writer, stats *wstats.WindowsC if stats.Processor != nil { fmt.Fprintf(w, "cpu.total_runtime_ns\t%d\t\n", stats.Processor.TotalRuntimeNS) fmt.Fprintf(w, "cpu.runtime_user_ns\t%d\t\n", stats.Processor.RuntimeUserNS) - fmt.Fprintf(w, "cpu.runtime_kernel_ns\t%d\t\n", stats.Processor.RuntimeUserNS) + fmt.Fprintf(w, "cpu.runtime_kernel_ns\t%d\t\n", stats.Processor.RuntimeKernelNS) } if stats.Memory != nil { fmt.Fprintf(w, "memory.commit_bytes\t%d\t\n", stats.Memory.MemoryUsageCommitBytes)