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

Function calculateCgroupBlockIO

pkg/statsutil/stats_linux.go:167–181  ·  view source on GitHub ↗
(metrics *v1.Metrics)

Source from the content-addressed store, hash-verified

165}
166
167func calculateCgroupBlockIO(metrics *v1.Metrics) (uint64, uint64) {
168 var blkRead, blkWrite uint64
169 for _, bioEntry := range metrics.Blkio.IoServiceBytesRecursive {
170 if len(bioEntry.Op) == 0 {
171 continue
172 }
173 switch bioEntry.Op[0] {
174 case 'r', 'R':
175 blkRead = blkRead + bioEntry.Value
176 case 'w', 'W':
177 blkWrite = blkWrite + bioEntry.Value
178 }
179 }
180 return blkRead, blkWrite
181}
182
183func calculateCgroup2IO(metrics *v2.Metrics) (uint64, uint64) {
184 var ioRead, ioWrite uint64

Callers 1

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