spec run server metric reporting

This commit is contained in:
npc0-hue
2026-08-10 18:57:07 +08:00
parent bd444f04b9
commit 89eaf1e3c6
5 changed files with 114 additions and 0 deletions
@@ -0,0 +1,25 @@
## Why
Generated Run packages register and supervise their server process, but never submit a metric sample. The platform consequently has no observed metrics and correctly renders every such server as waiting for Run reporting.
## What Changes
- Add Run-side periodic metric reporting for its bound server instance after registration.
- Derive online state only from Run's generic supervised-process records; report no game-specific player, TPS, or latency values.
- Include bounded host CPU, memory, and workspace-volume usage when the operating system collector can observe them, without exposing paths or credentials.
- Keep metric delivery on an independent, bounded reporting path so failed metric uploads do not block control, lifecycle jobs, logs, or artifacts.
## Capabilities
### New Capabilities
- `run-server-metrics`: Generic server-process and host-resource metric collection and Run-to-platform reporting.
### Modified Capabilities
- None.
## Impact
- Affects the independent `run/` runtime worker, its platform client contract implementation, and Run tests.
- Uses the existing signed `POST /api/v1/run/metrics/batches` platform route; no browser or game-plugin contract changes are required.