(ctx context.Context, dockerCli command.Cli, opts statsOptions, service []string)
| 63 | } |
| 64 | |
| 65 | func runStats(ctx context.Context, dockerCli command.Cli, opts statsOptions, service []string) error { |
| 66 | name, err := opts.ProjectOptions.toProjectName(ctx, dockerCli) |
| 67 | if err != nil { |
| 68 | return err |
| 69 | } |
| 70 | f := client.Filters{} |
| 71 | f.Add("label", fmt.Sprintf("%s=%s", api.ProjectLabel, name)) |
| 72 | |
| 73 | if len(service) > 0 { |
| 74 | f.Add("label", fmt.Sprintf("%s=%s", api.ServiceLabel, service[0])) |
| 75 | } |
| 76 | return container.RunStats(ctx, dockerCli, &container.StatsOptions{ |
| 77 | All: opts.all, |
| 78 | NoStream: opts.noStream, |
| 79 | NoTrunc: opts.noTrunc, |
| 80 | Format: opts.format, |
| 81 | Filters: f, |
| 82 | }) |
| 83 | } |
no test coverage detected