From 12e3d9d8a26d2c33d587dba9b7ea5b0dcfd92eea Mon Sep 17 00:00:00 2001 From: umohnani8 Date: Tue, 23 Jan 2018 16:50:20 -0500 Subject: Fix podman stats based on QE feedback QE found issues with formatting the go template and the man page was lacking information. Changed the format of the output to match latest docker. Add shortID function that returns the truncated ID Signed-off-by: umohnani8 Closes: #258 Approved by: rhatdan --- 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 e87654277..47fb16194 100644 --- a/libpod/stats.go +++ b/libpod/stats.go @@ -13,6 +13,7 @@ import ( // ContainerStats contains the statistics information for a running container type ContainerStats struct { ContainerID string + Name string CPU float64 CPUNano uint64 SystemNano uint64 @@ -30,6 +31,7 @@ type ContainerStats struct { func (c *Container) GetContainerStats(previousStats *ContainerStats) (*ContainerStats, error) { stats := new(ContainerStats) stats.ContainerID = c.ID() + stats.Name = c.Name() c.lock.Lock() defer c.lock.Unlock() if err := c.syncContainer(); err != nil { -- cgit v1.2.3-54-g00ecf