ctr: add some metric item

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 <aceapril@126.com>
This commit is contained in:
Ace-Tang 2018-10-16 16:54:02 +08:00
parent 0c5f8f63c3
commit 7ea75ef4a9

View File

@ -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, "", " ")