From 7ea75ef4a92e64948f100013fd9dcf5913489af0 Mon Sep 17 00:00:00 2001 From: Ace-Tang Date: Tue, 16 Oct 2018 16:54:02 +0800 Subject: [PATCH] ctr: add some metric item MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add memory limit, pid info into metric subcommand, since moby also show them. As blkio read/write IO need more calculation,not add them. Signed-off-by: Ace-Tang --- cmd/ctr/commands/tasks/metrics.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/ctr/commands/tasks/metrics.go b/cmd/ctr/commands/tasks/metrics.go index a60cddad5..dc0973070 100644 --- a/cmd/ctr/commands/tasks/metrics.go +++ b/cmd/ctr/commands/tasks/metrics.go @@ -90,9 +90,12 @@ var metricsCommand = cli.Command{ fmt.Fprintf(w, "METRIC\tVALUE\t\n") fmt.Fprintf(w, "memory.usage_in_bytes\t%d\t\n", data.Memory.Usage.Usage) + fmt.Fprintf(w, "memory.limit_in_bytes\t%d\t\n", data.Memory.Usage.Limit) fmt.Fprintf(w, "memory.stat.cache\t%d\t\n", data.Memory.TotalCache) fmt.Fprintf(w, "cpuacct.usage\t%d\t\n", data.CPU.Usage.Total) fmt.Fprintf(w, "cpuacct.usage_percpu\t%v\t\n", data.CPU.Usage.PerCPU) + fmt.Fprintf(w, "pids.current\t%v\t\n", data.Pids.Current) + fmt.Fprintf(w, "pids.limit\t%v\t\n", data.Pids.Limit) return w.Flush() case formatJSON: marshaledJSON, err := json.MarshalIndent(data, "", " ")