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

Calculate docker cpu percentage #859

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Conversation

dkeysil
Copy link
Contributor

@dkeysil dkeysil commented Apr 5, 2024

This is calculation function from the docker library - https://github.com/moby/moby/blob/eb131c5383db8cac633919f82abad86c99bffbe5/cli/command/container/stats_helpers.go#L175-L188

It calculates CPU usage as percentage

Right now this metric (resources.docker.cpu) is not really helpful because cpu.TotalUsage is always increasing.

@dkeysil dkeysil marked this pull request as draft April 5, 2024 13:44
@dkeysil dkeysil force-pushed the kisel/improve-docker-cpu-metric branch from 2a7e7ae to 51fbb0b Compare April 5, 2024 13:50
@dkeysil dkeysil force-pushed the kisel/improve-docker-cpu-metric branch from 51fbb0b to 749ce8f Compare April 5, 2024 15:56
@dkeysil dkeysil marked this pull request as ready for review April 8, 2024 07:55
@dkeysil dkeysil merged commit c34c465 into master Apr 12, 2024
10 checks passed
@dkeysil dkeysil deleted the kisel/improve-docker-cpu-metric branch April 12, 2024 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants