Skip to content
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 system usage message #12

Merged
merged 4 commits into from
Jun 13, 2024

Conversation

mebasoglu
Copy link
Contributor

Description

This PR creates system usage message.

Related links

It will be used in:

Tests performed

Tested on logging simulator with the sample data from Autoware tutorials.

Notes for reviewers

Should be merged with:

Interface changes

ROS Topic Changes

ROS Parameter Changes

Effects on system behavior

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

@xmfcx
Copy link
Contributor

xmfcx commented Jun 5, 2024

Current message:
SystemUsage.msg

std_msgs/Header header
uint32 pid
float32 cpu_usage_rate
float32 mem_usage_rate
uint64 mem_usage_kib

Let's name it ResourceUsageReport.msg

std_msgs/Header header

# Process identifier
uint32 pid

# CPU usage metrics
float32 cpu_usage_percentage  # CPU cores being utilized (e.g., 1.5 cores would be 150)

# Memory usage metrics
uint64 total_memory_bytes
uint64 used_memory_bytes
uint64 free_memory_bytes
float32 memory_usage_percentage

# Disk I/O metrics (rates in bytes per second)
float32 disk_read_bytes_per_sec
float32 disk_write_bytes_per_sec

# Network usage metrics (rates in bytes per second)
float32 network_receive_bytes_per_sec
float32 network_transmit_bytes_per_sec

Could you add these additional metrics too?

Most Autoware nodes don't need much disk usage but could be used for rosbag writing composable nodes maybe.

Network usage will definitely be useful, many times it even poses a bottleneck for the entire system.

And explicitly reporting total, used, free memory stats is useful, the listening side can decide how to use them.

Also changed the rate to percentage to express it more clearly.

Also prompted chatgpt a bit and I think the final one prompt could be a good start on gathering the remaining stats: https://chatgpt.com/share/16c1aca9-7d12-49eb-85c7-07d2b1e9a5b9

@xmfcx
Copy link
Contributor

xmfcx commented Jun 5, 2024

Maybe following: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes

We could name the cpu one to:
float32 cpu_cores_utilized # e.g. 1.5 physical CPU cores

Signed-off-by: Mehmet Emin BAŞOĞLU <[email protected]>
Signed-off-by: Mehmet Emin BAŞOĞLU <[email protected]>
Signed-off-by: Mehmet Emin BAŞOĞLU <[email protected]>
@xmfcx xmfcx enabled auto-merge (squash) June 13, 2024 10:48
@xmfcx xmfcx merged commit 268f19d into autowarefoundation:main Jun 13, 2024
9 checks passed
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.

2 participants