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

Function NewStats

cli/command/container/formatter_stats.go:117–123  ·  view source on GitHub ↗

NewStats returns a new Stats entity using the given ID, ID-prefix, or name to resolve the container.

(idOrName string)

Source from the content-addressed store, hash-verified

115// NewStats returns a new Stats entity using the given ID, ID-prefix, or
116// name to resolve the container.
117func NewStats(idOrName string) *Stats {
118 // FIXME(thaJeztah): "idOrName" is used for fuzzy-matching the container, which can result in multiple stats for the same container.
119 // We should resolve the canonical ID once, then use that as reference
120 // to prevent duplicates. Various parts in the code compare Container
121 // against "ID" only (not considering "name" or "ID-prefix").
122 return &Stats{StatsEntry: StatsEntry{Container: idOrName}}
123}
124
125// statsFormatWrite renders the context for a list of containers statistics
126func statsFormatWrite(ctx formatter.Context, stats []StatsEntry, osType string, trunc bool) error {

Callers 1

RunStatsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…