Skip to content

ctr: add new metrics subcommand#2504

Merged
stevvooe merged 2 commits intocontainerd:masterfrom
samuelkarp:ctr-t-metrics
Jul 30, 2018
Merged

ctr: add new metrics subcommand#2504
stevvooe merged 2 commits intocontainerd:masterfrom
samuelkarp:ctr-t-metrics

Conversation

@samuelkarp
Copy link
Copy Markdown
Member

This is a very simple new subcommand to ctr tasks that just displays a few metrics from a given container task. I wrote this as I was trying to understand how to deserialize a *types.Metric.Data, which is a *google_protobuf1.Any and there wasn't already an example in ctr.

I just picked a format and selected a few fields to display; happy to change any of these.

@samuelkarp
Copy link
Copy Markdown
Member Author

=== RUN   TestImagePullSchema1
--- FAIL: TestImagePullSchema1 (12.12s)
	client_test.go:309: failed to resolve reference "gcr.io/google_containers/pause:3.0@sha256:0d093c962a6c2dd8bb8727b661e2b5f13e9df884af9945b4cc7088d9350cd3ee": failed to do request: Head https://gcr.io/v2/google_containers/pause/manifests/sha256:0d093c962a6c2dd8bb8727b661e2b5f13e9df884af9945b4cc7088d9350cd3ee: dial tcp: lookup gcr.io: no such host

This AppVeyor failure looks unrelated to my change.

Comment thread cmd/ctr/commands/tasks/metrics.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we usually use a tabwriter for this, it makes it a little cleaner

Comment thread cmd/ctr/commands/tasks/metrics.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a flag, --format that will dump the raw object as json for people that want everything?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean --format=json and --format=table or something like that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@samuelkarp samuelkarp force-pushed the ctr-t-metrics branch 2 times, most recently from 5fc407a to 6410d28 Compare July 27, 2018 17:07
@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 27, 2018

Codecov Report

Merging #2504 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2504   +/-   ##
=======================================
  Coverage   44.74%   44.74%           
=======================================
  Files          93       93           
  Lines        9559     9559           
=======================================
  Hits         4277     4277           
  Misses       4589     4589           
  Partials      693      693
Flag Coverage Δ
#linux 48.95% <ø> (ø) ⬆️
#windows 41.04% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 985920c...9a34bb0. Read the comment docs.

Comment thread cmd/ctr/commands/tasks/metrics.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need Destination at all with cli

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

Copy link
Copy Markdown
Member

@stevvooe stevvooe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stevvooe stevvooe merged commit 920dc79 into containerd:master Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants