isKnownContainer is from https://github.com/docker/cli/blob/3fb4fb83dfb5db0c0753a8316f21aea54dab32c5/cli/command/container/stats_helpers.go#L44-L51
(cid string)
| 73 | |
| 74 | // isKnownContainer is from https://github.com/docker/cli/blob/3fb4fb83dfb5db0c0753a8316f21aea54dab32c5/cli/command/container/stats_helpers.go#L44-L51 |
| 75 | func (s *stats) isKnownContainer(cid string) (int, bool) { |
| 76 | for i, c := range s.cs { |
| 77 | if c.ID == cid { |
| 78 | return i, true |
| 79 | } |
| 80 | } |
| 81 | return -1, false |
| 82 | } |
| 83 | |
| 84 | // Stats displays a live stream of container(s) resource usage statistics. |
| 85 | func Stats(ctx context.Context, client *containerd.Client, containerIDs []string, options types.ContainerStatsOptions) error { |