MCPcopy Create free account
hub / github.com/docker/cli / TestCalculateBlockIO

Function TestCalculateBlockIO

cli/command/container/stats_helpers_test.go:33–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func TestCalculateBlockIO(t *testing.T) {
34 blkRead, blkWrite := calculateBlockIO(container.BlkioStats{
35 IoServiceBytesRecursive: []container.BlkioStatEntry{
36 {Major: 8, Minor: 0, Op: "read", Value: 1234},
37 {Major: 8, Minor: 1, Op: "read", Value: 4567},
38 {Major: 8, Minor: 0, Op: "Read", Value: 6},
39 {Major: 8, Minor: 1, Op: "Read", Value: 8},
40 {Major: 8, Minor: 0, Op: "write", Value: 123},
41 {Major: 8, Minor: 1, Op: "write", Value: 456},
42 {Major: 8, Minor: 0, Op: "Write", Value: 6},
43 {Major: 8, Minor: 1, Op: "Write", Value: 8},
44 {Major: 8, Minor: 1, Op: "", Value: 456},
45 },
46 })
47 if blkRead != 5815 {
48 t.Fatalf("blkRead = %d, want 5815", blkRead)
49 }
50 if blkWrite != 593 {
51 t.Fatalf("blkWrite = %d, want 593", blkWrite)
52 }
53}
54
55func inDelta(x, y, delta float64) func() (bool, string) {
56 return func() (bool, string) {

Callers

nothing calls this directly

Calls 1

calculateBlockIOFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…