-
Notifications
You must be signed in to change notification settings - Fork 540
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
fix!: host-metrics system.cpu.utilization
calculation fix
#1741
Merged
legendecas
merged 16 commits into
open-telemetry:main
from
david-luna:dluna/1718-fix-cpu-utilization
Nov 7, 2023
Merged
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5a65dd0
tests: tune the fake clock for testing
david-luna 69b8bbf
tests: tune the values to expect
david-luna b1b240e
chore: lint autofix
david-luna b1163ac
chore: improve os.cpus mock
david-luna 685788b
chore: revert implementation for process CPU usage
david-luna dec0119
Merge branch 'main' into dluna/1718-fix-cpu-utilization
david-luna 44961f5
Merge branch 'main' into dluna/1718-fix-cpu-utilization
david-luna e3c4668
chore: rename var
david-luna 8d403e5
Merge branch 'dluna/1718-fix-cpu-utilization' of github.com:david-lun…
david-luna 46bf903
chore: avoid having useless data upon 1st collection
david-luna c60197d
chore: remove comments
david-luna cea9d6c
Merge branch 'main' into dluna/1718-fix-cpu-utilization
david-luna 9dc836b
chore: change system.cpu attribute names to match semantic conventions
david-luna 1c92ae9
chore: update test
david-luna 7603e56
chore: lint fix
david-luna 768d62d
Merge branch 'main' into dluna/1718-fix-cpu-utilization
legendecas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,54 @@ | ||
[{ | ||
"model": "CPU @ 2.60GHz", | ||
"speed": 2600, | ||
"times": { | ||
"user": 90713560, | ||
"nice": 0, | ||
"sys": 63192630, | ||
"idle": 374870700, | ||
"irq": 0 | ||
} | ||
}, { | ||
"model": "CPU @ 2.60GHz", | ||
"speed": 2600, | ||
"times": { | ||
"user": 11005420, | ||
"nice": 0, | ||
"sys": 7678120, | ||
"idle": 510034800, | ||
"irq": 0 | ||
} | ||
} | ||
] | ||
[ | ||
[ | ||
{ | ||
"model": "CPU @ 2.60GHz", | ||
"speed": 2600, | ||
"// times": "this is the 1st collect of CPU data which will be used to calc utilization", | ||
"times": { | ||
"user": 90713560, | ||
"nice": 0, | ||
"sys": 63192630, | ||
"idle": 374870700, | ||
"irq": 0 | ||
} | ||
}, | ||
{ | ||
"model": "CPU @ 2.60GHz", | ||
"speed": 2600, | ||
"// times": "this is the 1st collect of CPU data which will be used to calc utilization", | ||
"times": { | ||
"user": 11005420, | ||
"nice": 0, | ||
"sys": 7678120, | ||
"idle": 510034800, | ||
"irq": 0 | ||
} | ||
} | ||
], | ||
[ | ||
{ | ||
"model": "CPU @ 2.60GHz", | ||
"speed": 2600, | ||
"// times": "assuming a time delta of 1000ms we distribute 70% to user, 20% to sys and 10% to idle", | ||
"times": { | ||
"user": 90714260, | ||
"nice": 0, | ||
"sys": 63192830, | ||
"idle": 374870800, | ||
"irq": 0 | ||
} | ||
}, | ||
{ | ||
"model": "CPU @ 2.60GHz", | ||
"speed": 2600, | ||
"// times": "assuming a time delta of 1000ms we distribute 30% to user, 50% to sys and 20% to idle", | ||
"times": { | ||
"user": 11005720, | ||
"nice": 0, | ||
"sys": 7678620, | ||
"idle": 510035000, | ||
"irq": 0 | ||
} | ||
} | ||
] | ||
] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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've added this enum to properly report the attributes with their full name as set on the semantic conventions
See: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/system/system-metrics.md#metric-systemcputime