Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

support live monitoring critool stats #467

Merged

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented May 31, 2019

Signed-off-by: yeya24 yb532204897@gmail.com

Add support for live critool stats;
Also refactor the table display

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 31, 2019
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 31, 2019
@yeya24
Copy link
Contributor Author

yeya24 commented May 31, 2019

ping @feiskyer

namespace = "NAMESPACE"
size = "SIZE"
tag = "TAG"
digest = "DIGEST"
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a prefix for those const names?

"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"golang.org/x/net/context"
pb "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
"sort"
"strings"
)
Copy link
Member

Choose a reason for hiding this comment

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

nit: move those two to the first group

if duration == 0 {
return fmt.Errorf("cpu stat is not updated during sample")
display := newTableDisplay(20, 1, 3, ' ', 0)
for range time.Tick(500 * time.Millisecond) {
Copy link
Member

Choose a reason for hiding this comment

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

Could we add a new option for this, e.g. --watch or -w?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think live monitoring is enabled by default, like docker stats. So do we still need this watch option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WDYT? @feiskyer Do we really need this option? What is the use case of non live monitoring?

Copy link
Member

Choose a reason for hiding this comment

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

just like kubectl top, it only show the output for one time. We can enable it by default, but it could be disabled by an option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your reply, I have added this -w option to enable live monitoring, PTAL.

Signed-off-by: yeya24 <yb532204897@gmail.com>

fix gometalinter

Signed-off-by: yeya24 <yb532204897@gmail.com>

add option watch

Signed-off-by: yeya24 <yb532204897@gmail.com>
@feiskyer
Copy link
Member

feiskyer commented Jun 4, 2019

thanks.
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 4, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer, yeya24

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 4, 2019
@feiskyer feiskyer closed this Jun 20, 2019
@feiskyer feiskyer reopened this Jun 20, 2019
@feiskyer
Copy link
Member

Close and re-open to trigger the failed travis CI.

@k8s-ci-robot k8s-ci-robot merged commit 0bc8dc4 into kubernetes-sigs:master Jun 20, 2019
@yeya24 yeya24 deleted the feature/refactor-display branch June 20, 2019 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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.

None yet

3 participants