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

Method getLibcontainerHandler

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

Source from the content-addressed store, hash-verified

286}
287
288func (h *crioContainerHandler) getLibcontainerHandler() *containerlibcontainer.Handler {
289 if h.pidKnown {
290 return h.libcontainerHandler
291 }
292
293 id := ContainerNameToCrioId(h.name)
294
295 cInfo, err := h.client.ContainerInfo(id)
296 if err != nil || cInfo.Pid == 0 {
297 return h.libcontainerHandler
298 }
299
300 h.pidKnown = true
301 h.libcontainerHandler = containerlibcontainer.NewHandler(h.cgroupManager, h.rootFs, cInfo.Pid, h.includedMetrics)
302
303 return h.libcontainerHandler
304}
305
306func (h *crioContainerHandler) GetStats() (*info.ContainerStats, error) {
307 libcontainerHandler := h.getLibcontainerHandler()

Callers 1

GetStatsMethod · 0.95

Calls 2

ContainerNameToCrioIdFunction · 0.85
ContainerInfoMethod · 0.65

Tested by

no test coverage detected