MCPcopy Create free account
hub / github.com/containerd/nerdctl / EntryName

Method EntryName

pkg/statsutil/stats.go:151–167  ·  view source on GitHub ↗

* a set of functions to format container stats */

(noTrunc bool)

Source from the content-addressed store, hash-verified

149a set of functions to format container stats
150*/
151func (s *StatsEntry) EntryName(noTrunc bool) string {
152 if len(s.Name) > 1 {
153 if !noTrunc {
154 var truncLen int
155 if strings.HasPrefix(s.Name, "k8s://") {
156 truncLen = 24
157 } else {
158 truncLen = 12
159 }
160 if len(s.Name) > truncLen {
161 return s.Name[:truncLen]
162 }
163 }
164 return s.Name
165 }
166 return "--"
167}
168
169func (s *StatsEntry) EntryID(noTrunc bool) string {
170 if !noTrunc {

Callers 1

RenderEntryFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected