-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Zero out stats values in the cli #10251
Conversation
var ( | ||
previousCpu uint64 | ||
previousSystem uint64 | ||
start = true | ||
dec = json.NewDecoder(stream) | ||
updates = make(chan *d, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for a struct of a pointer and an error interface, you don't need to make it a chan of pointer, chan of struct should be enough. So make(chan d, 1)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Google style guide proposing use pointers always if there are pointers fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is the advice i follow
b0850fd
to
887ecce
Compare
Based on some feedback, when you have a container via the cli that you are monitoring for stats, if you stop the container it will stay in the display but report the last datapoint that was received. This PR changes the display to zero out the values for containers where an update has not been received within a specified duration, i.e. 2 seconds. This signals the user that the container has stopped as it reports cpu and memory usage of 0. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
887ecce
to
bbc3849
Compare
LGTM |
LGTM |
Zero out stats values in the cli
Based on some feedback, when you have a container via the cli that you
are monitoring for stats, if you stop the container it will stay in the
display but report the last datapoint that was received.
This PR changes the display to zero out the values for containers where
an update has not been received within a specified duration, i.e. 2
seconds. This signals the user that the container has stopped as it
reports cpu and memory usage of 0.
Signed-off-by: Michael Crosby crosbymichael@gmail.com