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

Function TestDockerContainerCpuStats

integration/tests/api/docker_test.go:243–262  ·  view source on GitHub ↗

Check the CPU ContainerStats.

(t *testing.T)

Source from the content-addressed store, hash-verified

241
242// Check the CPU ContainerStats.
243func TestDockerContainerCpuStats(t *testing.T) {
244 fm := framework.New(t)
245 defer fm.Cleanup()
246
247 // Wait for the container to show up.
248 containerID := fm.Docker().RunBusybox("ping", "www.google.com")
249 waitForContainer(containerID, fm)
250
251 request := &info.ContainerInfoRequest{
252 NumStats: 1,
253 }
254 containerInfo, err := fm.Cadvisor().Client().DockerContainer(containerID, request)
255 if err != nil {
256 t.Fatal(err)
257 }
258 sanityCheck(containerID, containerInfo, t)
259
260 // Checks for CpuStats.
261 checkCPUStats(t, containerInfo.Stats[0].Cpu)
262}
263
264// Check the memory ContainerStats.
265func TestDockerContainerMemoryStats(t *testing.T) {

Callers

nothing calls this directly

Calls 10

NewFunction · 0.92
waitForContainerFunction · 0.85
sanityCheckFunction · 0.70
checkCPUStatsFunction · 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…