MCPcopy
hub / github.com/google/cadvisor / TestUpdateStats

Function TestUpdateStats

lib/manager/container_test.go:134–151  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

132}
133
134func TestUpdateStats(t *testing.T) {
135 statsList := itest.GenerateRandomStats(1, 4, 1*time.Second)
136 stats := statsList[0]
137
138 cd, mockHandler, memoryCache, _ := newTestContainerData(t)
139 mockHandler.On("GetStats").Return(
140 stats,
141 nil,
142 )
143
144 err := cd.updateStats()
145 if err != nil {
146 t.Fatal(err)
147 }
148
149 checkNumStats(t, memoryCache, 1)
150 mockHandler.AssertExpectations(t)
151}
152
153func TestUpdateSpec(t *testing.T) {
154 spec := itest.GenerateRandomContainerSpec(4)

Callers

nothing calls this directly

Calls 3

newTestContainerDataFunction · 0.85
checkNumStatsFunction · 0.85
updateStatsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…