-
Notifications
You must be signed in to change notification settings - Fork 2k
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
docker: use streaming stats collection to correct CPU stats #24229
Conversation
03467be
to
0c5da05
Compare
0c5da05
to
fee1cc1
Compare
In #23966 we switched to the official Docker SDK for the `docker` driver. In the process we refactored code around stats collection to use the "one shot" version of stats. Unfortunately this "one shot" stats collection does not include the `PreCPU` stats, which are the stats from the previous read. This breaks the calculation we use to determine CPU ticks, because now we're subtracting 0 from the current value to get the delta. Switch back to using the streaming stats collection. Add a test that fully exercises the `TaskStats` API. Fixes: #24224 Ref: https://hashicorp.atlassian.net/browse/NET-11348
fee1cc1
to
565b511
Compare
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!
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
In #23966 we switched to the official Docker SDK for the
docker
driver. In the process we refactored code around stats collection to use the "one shot" version of stats. Unfortunately this "one shot" stats collection does not include thePreCPU
stats, which are the stats from the previous read. This breaks the calculation we use to determine CPU ticks, because now we're subtracting 0 from the current value to get the delta.Switch back to using the streaming stats collection. Add a test that fully exercises the
TaskStats
API.Fixes: #24224
Ref: https://hashicorp.atlassian.net/browse/NET-11348
In addition to new tests here, I've tested manually with the setup described here #24224 (comment) and we get the expected results now.