Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add cri stats #209

Merged
merged 1 commit into from
Nov 30, 2017
Merged

Add cri stats #209

merged 1 commit into from
Nov 30, 2017

Conversation

Random-Liu
Copy link
Contributor

@Random-Liu Random-Liu commented Nov 30, 2017

Fixes #138.
Based on #208.

Note that we'll sample for 1 second for cpu percentage by default. The sample duration could be changed with --sample.

Help:

$ crictl stats --help
NAME:
   crictl stats - List container(s) resource usage statistics

USAGE:
   crictl stats [command options] [arguments...]

OPTIONS:
   --all, -a                  Show all containers (default shows just running)
   --id value                 Filter by container id
   --sandbox value            Filter by sandbox id
   --label value              Filter by key=value label
   --output value, -o value   Output format, One of: json|yaml|table
   --seconds value, -s value  Sample duration for CPU usage in seconds (default: 1)

Output for running containers:

$ crictl stats
CONTAINER           CPU %               MEM                 DISK                INODES
303cdce60ee9a       0.07                13.43MB             28.67kB             8
43b34bf65eb15       0.00                2.712MB             57.35kB             16
e0f6114591a9e       0.23                11.69MB             32.77kB             9
f8f112011f784       0.00                7.299MB             28.68kB             9

Output for all containers:

$ crictl stats -a
CONTAINER           CPU %               MEM                 DISK                INODES
26b3f9397a5f6       0.00                0B                  16.38kB             6
303cdce60ee9a       0.08                13.43MB             28.67kB             8
43b34bf65eb15       0.00                2.712MB             57.35kB             16
e0f6114591a9e       0.17                11.69MB             32.77kB             9
f8f112011f784       0.03                7.299MB             28.68kB             9

Filter for specific sandbox:

$ crictl stats --sandbox f4c59c78c6dbb
CONTAINER           CPU %               MEM                 DISK                INODES
303cdce60ee9a       0.02                13.43MB             28.67kB             8
e0f6114591a9e       0.15                11.69MB             32.77kB             9
f8f112011f784       0.00                7.299MB             28.68kB             9

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 30, 2017
@Random-Liu Random-Liu modified the milestone: v0.2 Nov 30, 2017
Signed-off-by: Lantao Liu <lantaol@google.com>
Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 30, 2017
@feiskyer feiskyer merged commit d736f60 into kubernetes-sigs:master Nov 30, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants