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

Function calculateCgroupNetwork

pkg/statsutil/stats_linux.go:203–214  ·  view source on GitHub ↗
(links []netlink.Link)

Source from the content-addressed store, hash-verified

201}
202
203func calculateCgroupNetwork(links []netlink.Link) (float64, float64) {
204 var rx, tx float64
205
206 for _, l := range links {
207 stats := l.Attrs().Statistics
208 if stats != nil {
209 rx += float64(stats.RxBytes)
210 tx += float64(stats.TxBytes)
211 }
212 }
213 return rx, tx
214}

Callers 2

SetCgroupStatsFieldsFunction · 0.85
SetCgroup2StatsFieldsFunction · 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…