-
Notifications
You must be signed in to change notification settings - Fork 126
app/starry: add resource monitoring visualization #1370
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
Merged
ZR233
merged 7 commits into
rcore-os:dev
from
2026-Proj4-YatSenOS:feat/app-starry-resource-monitor-ui
Jun 26, 2026
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8ba82b4
app/starry: fix offline resource monitor layout
Je-suis-un-chat 9398d3e
app/starry: shorten resource monitor qemu smoke
Je-suis-un-chat 57750fd
app/starry: fail fast in resource monitor qemu smoke
Je-suis-un-chat ea42040
app/starry: escape offline monitor log rendering
Je-suis-un-chat 748e2e7
chore: rerun ci
Je-suis-un-chat d32b754
app/starry: move resource monitor demo out of test-suit
Je-suis-un-chat 77c2422
chore: rerun CI
Je-suis-un-chat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| # StarryOS Resource Monitor Viewer | ||
|
|
||
| This directory contains a small user-space helper for collecting and replaying | ||
| resource-monitoring data for StarryOS application experiments. It is intended | ||
| for offline board/QEMU debugging and demo evidence, not for cloud monitoring. | ||
|
|
||
| The feature has two parts: | ||
|
|
||
| - `system-monitor.sh`: a POSIX shell collector that samples existing `/proc` | ||
| files and writes local CSV/JSONL logs. | ||
| - `offline-viewer/index.html`: a self-contained static HTML page that imports the | ||
| logs with the browser File API and renders charts/tables without network | ||
| access. | ||
|
|
||
| ## Scope | ||
|
|
||
| This is an application-layer tool for StarryOS user-space experiments. It does | ||
| not add kernel counters, drivers, NPU tracing, USB tracing, robot control logic, | ||
| or online telemetry services. When a metric is not exposed by the current OS | ||
| interface, the collector writes `NA` instead of inventing a value. | ||
|
|
||
| The viewer can display optional `robot_trace.csv` files when they are provided, | ||
| but this change does not include a robot test script. Precise robot/AI stage | ||
| tracing requires the application workload to emit those timing fields; this | ||
| helper only defines and visualizes the log format. | ||
|
|
||
| ## Log Files | ||
|
|
||
| The viewer accepts the following files for both StarryOS and Linux baseline | ||
| runs: | ||
|
|
||
| - `system_metrics.csv` | ||
| - `robot_trace.csv` (optional; frame-level robot/AI trace) | ||
| - `events.jsonl` | ||
|
|
||
| `system_metrics.csv` includes fields such as: | ||
|
|
||
| ```text | ||
| timestamp_ms,uptime_ms,cpu_total_pct,cpu0_pct,...,run_queue_len,ctxt_delta,irq_delta,mem_total_kib,mem_used_kib,mem_free_kib,mem_peak_kib,page_alloc_delta,page_free_delta,fs_read_delta,fs_write_delta | ||
| ``` | ||
|
|
||
| `events.jsonl` records one JSON object per line, for example monitor start/stop | ||
| or device/runtime events. | ||
|
|
||
| ## Collect Logs | ||
|
|
||
| Run the collector inside the target system. If it runs on host Linux, it collects | ||
| host Linux data; if it runs inside StarryOS QEMU or a StarryOS board shell, it | ||
| collects StarryOS data. | ||
|
|
||
| ```sh | ||
| cd apps/starry/resource-monitor | ||
| sh system-monitor.sh \ | ||
| --out-dir /root/monitor \ | ||
| --interval-sec 1 \ | ||
| --duration-sec 60 | ||
| ``` | ||
|
|
||
| Expected outputs: | ||
|
|
||
| ```text | ||
| /root/monitor/system_metrics.csv | ||
| /root/monitor/events.jsonl | ||
| ``` | ||
|
|
||
| Export these files to the host through serial logs, SD card, USB storage, TFTP, | ||
| rootfs copy, or a local QEMU shared directory. | ||
|
|
||
| ## Open The Offline Viewer | ||
|
|
||
| On the host: | ||
|
|
||
| ```sh | ||
| cd apps/starry/resource-monitor/offline-viewer | ||
| python3 -m http.server 8000 | ||
| ``` | ||
|
|
||
| Then open: | ||
|
|
||
| ```text | ||
| http://127.0.0.1:8000/ | ||
| ``` | ||
|
|
||
| The page can also be opened directly from the filesystem in browsers that allow | ||
| local file import. | ||
|
|
||
| ## StarryOS QEMU Smoke Check | ||
|
ZR233 marked this conversation as resolved.
Outdated
|
||
|
|
||
| A small QEMU test case is provided under: | ||
|
|
||
| ```text | ||
| test-suit/starryos/qemu-smp1/offline-monitor/ | ||
| ``` | ||
|
|
||
| It injects the collector into the StarryOS rootfs, runs it for a short | ||
| 5-second smoke interval, and prints the generated logs between markers so the | ||
| host can extract them. | ||
|
|
||
| ```sh | ||
| cargo xtask starry test qemu --arch x86_64 -c qemu-smp1/offline-monitor | ||
| ``` | ||
|
|
||
| Use the extracted CSV/JSONL files as input to the offline viewer. On current | ||
| StarryOS branches, some `/proc` counters may be absent or partial; the collector | ||
| keeps those fields as `NA` and still validates the offline log path. | ||
|
|
||
| ## Fair Comparisons | ||
|
|
||
| For a meaningful Linux vs StarryOS comparison, collect both datasets under the | ||
| same conditions: same QEMU memory size/core count or the same RK3588 board, | ||
| same sampling interval, same duration, and the same application workload. Host | ||
| Linux data should only be used for viewer smoke testing, not as a strict baseline | ||
| against StarryOS QEMU. | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.