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

Function calculateBlockIO

cli/command/container/stats_helpers.go:216–230  ·  view source on GitHub ↗
(blkio container.BlkioStats)

Source from the content-addressed store, hash-verified

214}
215
216func calculateBlockIO(blkio container.BlkioStats) (uint64, uint64) {
217 var blkRead, blkWrite uint64
218 for _, bioEntry := range blkio.IoServiceBytesRecursive {
219 if len(bioEntry.Op) == 0 {
220 continue
221 }
222 switch bioEntry.Op[0] {
223 case 'r', 'R':
224 blkRead += bioEntry.Value
225 case 'w', 'W':
226 blkWrite += bioEntry.Value
227 }
228 }
229 return blkRead, blkWrite
230}
231
232func calculateNetwork(network map[string]container.NetworkStats) (float64, float64) {
233 var rx, tx float64

Callers 2

collectFunction · 0.85
TestCalculateBlockIOFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestCalculateBlockIOFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…