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

Backport of docker: use streaming stats collection to correct CPU stats into release/1.9.x #24238

Merged

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #24229 to be assessed for backporting due to the inclusion of the label backport/1.9.x.

The below text is copied from the body of the original PR.


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


In addition to new tests here, I've tested manually with the setup described here #24224 (comment) and we get the expected results now.


Overview of commits

@tgross tgross merged commit 6c3f222 into release/1.9.x Oct 17, 2024
20 checks passed
@tgross tgross deleted the backport/docker-stats-cpu-ticks/equally-intense-trout branch October 17, 2024 12:47
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants