Add network bandwidth to node_stats #42
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_compute#42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Add network RX/TX bytes per second to NodeStats so users can monitor bandwidth usage per node.
Fields to add to NodeStats:
Implementation
Definition of Done
Implementation Spec for Issue #42: Add Network Bandwidth to NodeStats
Objective
Add network RX/TX bytes-per-second and total counters to
NodeStatsso users can monitor bandwidth usage per node in both the local admin dashboard and the explorer-aggregated node view.Requirements
NodeStats:network_rx_bytes_per_sec(u64),network_tx_bytes_per_sec(u64),network_rx_bytes_total(u64),network_tx_bytes_total(u64)sysinfo::Networksto collect network data, excluding loopback interfacesExplorerNodeschemaformatBandwidth()JS helperFiles to Modify
schemas/cloud/cloud.oschemaschemas/explorer/explorer.oschemacrates/hero_compute_server/src/cloud/stats.rscrates/hero_compute_server/src/cloud/rpc.rscrates/hero_compute_server/src/heartbeat_sender.rscrates/hero_compute_explorer/src/explorer/rpc.rscrates/hero_compute_ui/static/js/dashboard.jscrates/hero_compute_ui/templates/admin.htmlcrates/hero_compute_ui/templates/nodes.htmlImplementation Steps
Acceptance Criteria
Test Results
Breakdown by crate
All tests passing on
developmentbranch (commitc457b8a).Implementation Summary: Network Statistics
20 files changed | ~363 lines added
Changes
Schema (2 files)
schemas/cloud/cloud.oschema— Added 4 network fields toNodeStatsembedded typeschemas/explorer/explorer.oschema— Added 4 network fields toExplorerNode+node_heartbeatparamsAuto-generated (8 files)
types_generated.rs,rpc_generated.rs,osis_server_generated.rs,openrpc.json,types_wasm_generated.rs,sdk/js/types_generated.js— for both server and explorer cratesBackend (4 files)
crates/hero_compute_server/src/cloud/stats.rs— Addedsysinfo::NetworkstoStatsCollector, two-phase network sampling (piggybacks on CPU 200ms sleep), excludes loopback interfaces, computes bytes/sec and totalscrates/hero_compute_server/src/cloud/rpc.rs— Added 4 network fields tonode_stats()JSON responsecrates/hero_compute_server/src/heartbeat_sender.rs— Added 4 network fields to heartbeat payloadcrates/hero_compute_explorer/src/explorer/rpc.rs— Added 4 network params tonode_heartbeathandler, stores onExplorerNodein both update and create branchesFrontend (3 files)
crates/hero_compute_ui/static/js/dashboard.js— AddedformatBandwidth()andformatBytes()helpers, updated explorer node card rendering with network statscrates/hero_compute_ui/templates/admin.html— Added Network health card with sparkline (bi-arrow-down-upicon, cyan color)crates/hero_compute_ui/templates/nodes.html— Added Network health card to live stats section with sparklineTest Results
Implementation committed:
d595df9Browse:
d595df9Done