-
Notifications
You must be signed in to change notification settings - Fork 703
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
feat(system): create a package to monitor component containers #7094
Merged
xmfcx
merged 54 commits into
autowarefoundation:main
from
mebasoglu:memin/dev/system-usage
Jul 12, 2024
Merged
feat(system): create a package to monitor component containers #7094
xmfcx
merged 54 commits into
autowarefoundation:main
from
mebasoglu:memin/dev/system-usage
Jul 12, 2024
Conversation
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
e53eb7a
to
feae4bf
Compare
4 tasks
7 tasks
c7dd825
to
f53557d
Compare
4cf87ab
to
d9e35bb
Compare
afa00f3
to
1f40ad3
Compare
1f40ad3
to
612c786
Compare
Could you add a readme file? |
612c786
to
a991b3e
Compare
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
7f920fc
to
39dc9c5
Compare
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
xmfcx
approved these changes
Jul 12, 2024
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.
Thanks, I've tested it with the rosbag replay simulation and loaded with
ros2 launch autoware_launch logging_simulator.launch.xml map_path:=$HOME/autoware_map/sample-map-rosbag vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit
ros2 component load /pointcloud_container autoware_component_monitor autoware::component_monitor::ComponentMonitor -p publish_rate:=10.0 --node-namespace /pointcloud_container
ros2 topic echo /pointcloud_container/component_monitor/component_system_usage
and it works!
Ariiees
pushed a commit
to Ariiees/autoware.universe
that referenced
this pull request
Jul 22, 2024
…arefoundation#7094) Signed-off-by: Mehmet Emin BAŞOĞLU <memin@leodrive.ai>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
component:system
System design and integration. (auto-assigned)
run:build-and-test-differential
Mark to enable build-and-test-differential workflow. (used-by-ci)
run:deploy-docs
Mark for deploy-docs action generation. (used-by-ci)
type:documentation
Creating or refining documentation. (auto-assigned)
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 package
autoware_component_monitor
under the system. It aims to attach existing component containers and monitor their CPU and memory usages.Related links
Issue:
Corresponding message type PR:
Tests performed
Logging simulator was used with the sample data on Autoware tutorials. The composable node was attached to
pointcloud_container
and published the system usage of process. The launch file inside the package was used to attach. Here is a sample topic output:Here is a sample visualization of
pointcloud_container
with the sample bag on Foxglove:Notes for reviewers
The CPU monitor inside the
system_monitor
package usesboost::process
to runmpstat
command, gets the stdout and parses it to get necessary information.https://github.com/autowarefoundation/autoware.universe/blob/003ee0c9da3f341aefecb16fc216af8471b5238a/system/system_monitor/src/cpu_monitor/cpu_monitor_base.cpp#L139
The same mechanism was also used in this package. The
top
package was preferred to get CPU and memory usage.top -b -d 0.1 -n 1 -p PID
outputs the memory usage as below:%MEM
is calculated with theRES
field, which is the physical memory usage. These fields are parsed inside the node for memory usage.%CPU
field is parsed to get CPU usage rate.The
LC_NUMERIC
environment variable determines the output format of floating numbers. In my computer it isLC_NUMERIC=tr_TR.UTF-8
and because of thattop
uses,
as the separator for floating numbers. To ensure that it is always.
, this environment variable is overridden.while (rclcpp::ok())
loop was used with arclcpp::Rate
to monitor periodically. The loop is inside a try-catch block so that if the node dies, it won't crash the whole component.Interface changes
ROS Topic Changes
component_system_usage
autoware_internal_msgs/SystemUsage
A message type was created as follows (autowarefoundation/autoware_internal_msgs#12):
It is currently planned to have this message inside
autoware_internal_msgs
.ROS Parameter Changes
Currently, there aren't any parameters.
Effects on system behavior
It doesn't affect the system. The node is attached to an existing container and publishes a message if there is a subscriber.
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.