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

Method GetStats

lib/container/crio/handler.go:306–327  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

304}
305
306func (h *crioContainerHandler) GetStats() (*info.ContainerStats, error) {
307 libcontainerHandler := h.getLibcontainerHandler()
308 stats, err := libcontainerHandler.GetStats()
309 if err != nil {
310 return stats, err
311 }
312
313 if h.includedMetrics.Has(container.NetworkUsageMetrics) && (stats.Network == nil || len(stats.Network.Interfaces) == 0) {
314 // No network related information indicates that the pid of the
315 // container is not longer valid and we need to ask crio to
316 // provide the pid of another container from that pod
317 h.pidKnown = false
318 return stats, nil
319 }
320 // Get filesystem stats.
321 err = h.getFsStats(stats)
322 if err != nil {
323 return stats, err
324 }
325
326 return stats, nil
327}
328
329func (h *crioContainerHandler) ListContainers(listType container.ListType) ([]info.ContainerReference, error) {
330 // No-op for Docker driver.

Callers

nothing calls this directly

Calls 4

getFsStatsMethod · 0.95
HasMethod · 0.80
GetStatsMethod · 0.65

Tested by

no test coverage detected