feat(social): system resource monitor for Jetson Orin (Issue #355) #357

Merged
sl-jetson merged 1 commits from sl-jetson/issue-355-sysmon into main 2026-03-03 14:32:49 -05:00
Collaborator

Summary

  • New sysmon_node: polls /proc/stat (CPU delta), /proc/meminfo (RAM), os.statvfs (disk), /sys/devices/gpu.0/load (GPU), and thermal zone sysfs; publishes JSON on /saltybot/system_resources at 1 Hz
  • Per-mille GPU load automatically converted to percent on Jetson kernels that report 0–1000
  • All I/O functions injectable for offline testing; pure helpers fully unit-tested without /proc or /sys
  • 67/67 tests passing

JSON Payload

{
  "ts": 1234567890.123,
  "cpu_percent": [45.2, 32.1, 67.8],
  "cpu_avg_percent": 48.4,
  "ram_total_mb": 16384.0,
  "ram_used_mb": 4096.0,
  "ram_percent": 25.0,
  "disk_total_gb": 64.0,
  "disk_used_gb": 12.5,
  "disk_percent": 19.5,
  "gpu_percent": 42.0,
  "thermal": {"CPU-therm": 47.5, "GPU-therm": 43.2}
}

Files

  • saltybot_social/sysmon_node.py — node + pure helpers
  • config/sysmon_params.yaml — default parameters
  • launch/sysmon.launch.py — launch description
  • test/test_sysmon.py — 67 offline tests
  • setup.pysysmon_node entry point added

Test plan

  • python3 -m pytest test/test_sysmon.py -v — 67/67 passed
  • On Jetson Orin: ros2 launch saltybot_social sysmon.launch.py
  • Verify /saltybot/system_resources JSON on ros2 topic echo

🤖 Generated with Claude Code

## Summary - New `sysmon_node`: polls `/proc/stat` (CPU delta), `/proc/meminfo` (RAM), `os.statvfs` (disk), `/sys/devices/gpu.0/load` (GPU), and thermal zone sysfs; publishes JSON on `/saltybot/system_resources` at 1 Hz - Per-mille GPU load automatically converted to percent on Jetson kernels that report 0–1000 - All I/O functions injectable for offline testing; pure helpers fully unit-tested without `/proc` or `/sys` - 67/67 tests passing ## JSON Payload ```json { "ts": 1234567890.123, "cpu_percent": [45.2, 32.1, 67.8], "cpu_avg_percent": 48.4, "ram_total_mb": 16384.0, "ram_used_mb": 4096.0, "ram_percent": 25.0, "disk_total_gb": 64.0, "disk_used_gb": 12.5, "disk_percent": 19.5, "gpu_percent": 42.0, "thermal": {"CPU-therm": 47.5, "GPU-therm": 43.2} } ``` ## Files - `saltybot_social/sysmon_node.py` — node + pure helpers - `config/sysmon_params.yaml` — default parameters - `launch/sysmon.launch.py` — launch description - `test/test_sysmon.py` — 67 offline tests - `setup.py` — `sysmon_node` entry point added ## Test plan - [x] `python3 -m pytest test/test_sysmon.py -v` — 67/67 passed - [ ] On Jetson Orin: `ros2 launch saltybot_social sysmon.launch.py` - [ ] Verify `/saltybot/system_resources` JSON on `ros2 topic echo` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sl-webui added 1 commit 2026-03-03 13:55:06 -05:00
feat(social): system resource monitor for Jetson Orin (Issue #355)
Some checks failed
social-bot integration tests / Lint (flake8 + pep257) (push) Failing after 9s
social-bot integration tests / Core integration tests (mock sensors, no GPU) (push) Has been skipped
social-bot integration tests / Lint (flake8 + pep257) (pull_request) Failing after 9s
social-bot integration tests / Core integration tests (mock sensors, no GPU) (pull_request) Has been skipped
social-bot integration tests / Latency profiling (GPU, Orin) (push) Has been cancelled
social-bot integration tests / Latency profiling (GPU, Orin) (pull_request) Has been cancelled
0af4441120
Polls /proc/stat (CPU delta), /proc/meminfo (RAM), os.statvfs (disk),
/sys/devices/gpu.0/load (GPU), and thermal zone sysfs paths; publishes
JSON payload on /saltybot/system_resources at 1 Hz.

Pure helpers (parse_proc_stat, cpu_percent_from_stats, parse_meminfo,
compute_ram_stats, read_disk_usage, read_gpu_load, read_thermal_zones)
are all unit-tested offline.  Injectable I/O on SysmonNode allows full
node tick tests without /proc or /sys.  67/67 tests passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sl-jetson merged commit f7f89403d5 into main 2026-03-03 14:32:49 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seb/saltylab-firmware#357
No description provided.