()
| 342 | } |
| 343 | |
| 344 | func (h *containerHandler) GetStats() (*info.ContainerStats, error) { |
| 345 | // TODO(vmarmol): Get from libcontainer API instead of cgroup manager when we don't have to support older Dockers. |
| 346 | stats, err := h.libcontainerHandler.GetStats() |
| 347 | if err != nil { |
| 348 | return stats, err |
| 349 | } |
| 350 | |
| 351 | // We assume that if Inspect fails then the container is not known to docker. |
| 352 | res, err := h.client.ContainerInspect(context.Background(), h.reference.Id, dclient.ContainerInspectOptions{}) |
| 353 | if err != nil { |
| 354 | return nil, fmt.Errorf("failed to inspect container %q: %v", h.reference.Id, err) |
| 355 | } |
| 356 | ctnr := res.Container |
| 357 | |
| 358 | if ctnr.State.Health != nil { |
| 359 | stats.Health.Status = string(ctnr.State.Health.Status) |
| 360 | } |
| 361 | |
| 362 | // Get filesystem stats. |
| 363 | err = FsStats(stats, h.machineInfoFactory, h.metrics, h.storageDriver, |
| 364 | h.fsHandler, h.fsInfo, h.thinPoolName, h.rootfsStorageDir, h.zfsParent) |
| 365 | if err != nil { |
| 366 | return stats, err |
| 367 | } |
| 368 | |
| 369 | return stats, nil |
| 370 | } |
| 371 | |
| 372 | func (h *containerHandler) ListContainers(container.ListType) ([]info.ContainerReference, error) { |
| 373 | return []info.ContainerReference{}, nil |
nothing calls this directly
no test coverage detected