fix: add process_tree tracking mode for consistent CPU/RAM monitoring#1141
Closed
wangwangbobo wants to merge 1 commit intomlco2:masterfrom
Closed
fix: add process_tree tracking mode for consistent CPU/RAM monitoring#1141wangwangbobo wants to merge 1 commit intomlco2:masterfrom
wangwangbobo wants to merge 1 commit intomlco2:masterfrom
Conversation
- Add 'process_tree' as a valid tracking_mode option - Implement process_tree mode to sum CPU percent for process and children - Makes CPU monitoring behavior consistent with RAM monitoring - Fixes issue mlco2#976
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR adds a new
process_treetracking mode to the CPU monitoring module to make its behavior consistent with RAM monitoring.Related Issue
Fixes #976
Changes
process_treeas a validtracking_modeoption in CPU class initializationprocess_treemode that sums CPU percent for the main process and all child processesCode Changes
codecarbon/external/hardware.py:process_treeto allowed tracking modesprocess_treebranch with CPU percent summation logicTesting
The implementation follows the same pattern as RAM monitoring (
codecarbon/external/ram.py) which already uses child process tracking.Type: Bug Fix
Lines Changed: ~14 lines
Tracking Mode: New option for consistent process tree monitoring