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

Function TestDockerContainerMemoryStats

integration/tests/api/docker_test.go:265–282  ·  view source on GitHub ↗

Check the memory ContainerStats.

(t *testing.T)

Source from the content-addressed store, hash-verified

263
264// Check the memory ContainerStats.
265func TestDockerContainerMemoryStats(t *testing.T) {
266 fm := framework.New(t)
267 defer fm.Cleanup()
268
269 // Wait for the container to show up.
270 containerID := fm.Docker().RunBusybox("ping", "www.google.com")
271 waitForContainer(containerID, fm)
272
273 request := &info.ContainerInfoRequest{
274 NumStats: 1,
275 }
276 containerInfo, err := fm.Cadvisor().Client().DockerContainer(containerID, request)
277 require.NoError(t, err)
278 sanityCheck(containerID, containerInfo, t)
279
280 // Checks for MemoryStats.
281 checkMemoryStats(t, containerInfo.Stats[0].Memory)
282}
283
284// Check the network ContainerStats.
285func TestDockerContainerNetworkStats(t *testing.T) {

Callers

nothing calls this directly

Calls 10

NewFunction · 0.92
waitForContainerFunction · 0.85
sanityCheckFunction · 0.70
checkMemoryStatsFunction · 0.70
CleanupMethod · 0.65
RunBusyboxMethod · 0.65
DockerMethod · 0.65
DockerContainerMethod · 0.65
ClientMethod · 0.65
CadvisorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…