-
Notifications
You must be signed in to change notification settings - Fork 722
fix(cpu_monitor): collect cpu information on timer thread #10545
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
base: main
Are you sure you want to change the base?
fix(cpu_monitor): collect cpu information on timer thread #10545
Conversation
* Fixed existing code to meet Autoware coding style guide. Signed-off-by: Masaki NISHIKAWA <masaki.nishikawa@tier4.jp>
* CPU temperatures are checked by timer thread and published by publisher thread. * Other CPU statics will follow the frame work. Signed-off-by: Masaki NISHIKAWA <masaki.nishikawa@tier4.jp>
* Moved CPU usage measurement to onTimer() thread from the publishing thread Signed-off-by: Masaki NISHIKAWA <masaki.nishikawa@tier4.jp>
* Moved load-average measurement to onTimer() thread from the publishing thread Signed-off-by: Masaki NISHIKAWA <masaki.nishikawa@tier4.jp>
* Moved CPU frequency measurement to onTimer() thread from the publishing thread Signed-off-by: Masaki NISHIKAWA <masaki.nishikawa@tier4.jp>
* Gave up to move checking of thermal throttling to timer callback context. * Implemented reporting of additional error information. * Implemented exception handling for boost::process::child(). Signed-off-by: Masaki NISHIKAWA <masaki.nishikawa@tier4.jp>
* Modernized "for loops". * Minor fixes befor submitting a PR. Signed-off-by: Masaki NISHIKAWA <masaki.nishikawa@tier4.jp>
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
* Fixed problems reported by Draft PR CI tools. Signed-off-by: Masaki NISHIKAWA <masaki.nishikawa@tier4.jp>
…timer-thread' into fix/cpu_monitor-collect-info-on-timer-thread Signed-off-by: Masaki NISHIKAWA <masaki.nishikawa@tier4.jp>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10545 +/- ##
==========================================
- Coverage 24.96% 24.91% -0.05%
==========================================
Files 1351 1351
Lines 105116 105229 +113
Branches 39752 39757 +5
==========================================
- Hits 26238 26219 -19
- Misses 76386 76519 +133
+ Partials 2492 2491 -1
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* Fixed problems reported by Draft PR CI tools. Signed-off-by: Masaki NISHIKAWA <masaki.nishikawa@tier4.jp>
* Minimized critical sections locked by mutex_. Signed-off-by: Masaki NISHIKAWA <masaki.nishikawa@tier4.jp>
…timer-thread' into fix/cpu_monitor-collect-info-on-timer-thread
* Fixed a minor problem reported by PR CI workflow. Signed-off-by: Masaki NISHIKAWA <masaki.nishikawa@tier4.jp>
…timer-thread' into fix/cpu_monitor-collect-info-on-timer-thread
Description
As reported on #10554 , the "cpu_monitor" node collects the following CPU statistics in the context of publishing the "/diagnostics" topic.
In addition to "sleeping 1 second in mpstat", other operations take a considerable amount of time.
As a result, publishing intervals from the "cpu_monitor" node are longer than expected (1 second).
This PR makes the following changes to the way the "cpu_monitor" node works:
Handling of thermal throttling is intentionally left unchanged because:
Related links
Parent Issue:
Private Links:
How was this PR tested?
Notes for reviewers
None.
Interface changes
None.
The parameters of the "cpu_monitor" node are now explicitly declared as "read-only".
They had been "read-only" (i.e. they can't be modified after initialization) implicitly.
Effects on system behavior
None.