summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-06-14 13:12:17 +0000
committerGitHub <noreply@github.com>2022-06-14 13:12:17 +0000
commit78ecdad5f8f16dbb6146f2741a3d7ead1ce837bc (patch)
treec6214d1b51693315139277932ee145a51b13a183 /cmd/podman
parent9fac1b335f681400a029e9d8014f45fa5634ec40 (diff)
parent608ad7d1139d80093d1ddd933027d31af7fdee83 (diff)
downloadpodman-78ecdad5f8f16dbb6146f2741a3d7ead1ce837bc.tar.gz
podman-78ecdad5f8f16dbb6146f2741a3d7ead1ce837bc.tar.bz2
podman-78ecdad5f8f16dbb6146f2741a3d7ead1ce837bc.zip
Merge pull request #14580 from jakecorrenti/stats-on-non-running-container
Non-running containers now report statistics via the `podman stats`
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/containers/stats.go12
1 files changed, 1 insertions, 11 deletions
diff --git a/cmd/podman/containers/stats.go b/cmd/podman/containers/stats.go
index 500671d31..02f8c6970 100644
--- a/cmd/podman/containers/stats.go
+++ b/cmd/podman/containers/stats.go
@@ -214,10 +214,6 @@ func (s *containerStats) BlockIO() string {
}
func (s *containerStats) PIDS() string {
- if s.PIDs == 0 {
- // If things go bazinga, return a safe value
- return "--"
- }
return fmt.Sprintf("%d", s.PIDs)
}
@@ -231,7 +227,7 @@ func (s *containerStats) MemUsageBytes() string {
func floatToPercentString(f float64) string {
strippedFloat, err := utils.RemoveScientificNotationFromFloat(f)
- if err != nil || strippedFloat == 0 {
+ if err != nil {
// If things go bazinga, return a safe value
return "--"
}
@@ -239,16 +235,10 @@ func floatToPercentString(f float64) string {
}
func combineHumanValues(a, b uint64) string {
- if a == 0 && b == 0 {
- return "-- / --"
- }
return fmt.Sprintf("%s / %s", units.HumanSize(float64(a)), units.HumanSize(float64(b)))
}
func combineBytesValues(a, b uint64) string {
- if a == 0 && b == 0 {
- return "-- / --"
- }
return fmt.Sprintf("%s / %s", units.BytesSize(float64(a)), units.BytesSize(float64(b)))
}