Skip to content

Calculate docker cpu percentage#859

Merged
dkeysil merged 1 commit intomasterfrom
kisel/improve-docker-cpu-metric
Apr 12, 2024
Merged

Calculate docker cpu percentage#859
dkeysil merged 1 commit intomasterfrom
kisel/improve-docker-cpu-metric

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
@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