MCPcopy Index your code
hub / github.com/docker/cli / calculateMemPercentUnixNoCache

Function calculateMemPercentUnixNoCache

cli/command/container/stats_helpers.go:266–273  ·  view source on GitHub ↗
(limit float64, usedNoCache float64)

Source from the content-addressed store, hash-verified

264}
265
266func calculateMemPercentUnixNoCache(limit float64, usedNoCache float64) float64 {
267 // MemoryStats.Limit will never be 0 unless the container is not running and we haven't
268 // got any data from cgroup
269 if limit != 0 {
270 return usedNoCache / limit * 100.0
271 }
272 return 0
273}

Callers 2

collectFunction · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…