-
Notifications
You must be signed in to change notification settings - Fork 950
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
feature: add stats api in daemon side #2112
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2112 +/- ##
==========================================
+ Coverage 59.63% 64.36% +4.73%
==========================================
Files 208 209 +1
Lines 16482 16596 +114
==========================================
+ Hits 9829 10682 +853
+ Misses 5453 4584 -869
- Partials 1200 1330 +130
|
logrus.Infof("context is cancelled when streaming stats of container %s", c.ID) | ||
return nil | ||
default: | ||
logrus.Debugf("Start to stream stats of container %s", c.ID) |
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.
since we don't have event listener for specific container right now, I think we should check the status of container before get stat. If the status has been changed from running to stopped, we should exit the loop.
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.
I checked the existing moby api and it doesn't exit and will wait for next restart.
ThrottledTime: metric.CPU.Throttling.ThrottledTime, | ||
}, | ||
}, | ||
PrecpuStats: &types.CPUStats{}, |
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.
If we don't support this right now, could we remove this part and add the TODO?
Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
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.
LGTM
Signed-off-by: Allen Sun allensun.shl@alibaba-inc.com
Ⅰ. Describe what this PR did
This PR adds the stats API in daemon side. Here we defined the API:
Ⅱ. Does this pull request fix one issue?
this fixes the first part of issue #2086
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
let me add client side implementation and then add test case.
Ⅳ. Describe how to verify it
and we can also set the stream query as true to stream stats of a container.
Ⅴ. Special notes for reviews
none