Goal
Expose safe, typed measurements of the managed engine's P2P activity and computer-resource use.
Scope
- Add typed
SessionStatistics for status, active peers, download/upload rates, and downloaded/uploaded totals from the validated Ace Stream session statistics endpoint.
- Add typed
EngineRuntimeMetrics for container state, uptime, CPU usage, memory usage/limit, process count, and cache usage/configured limit.
- Obtain Docker metrics only for the labelled EngineKit-managed container using fixed
Process argument arrays; never execute a shell or accept arbitrary container names or Docker arguments.
- Do not label Docker network transmit bytes as P2P upload: they also include the local HTTP stream sent to IINA. Ace Stream session statistics are authoritative for peer transfer figures.
- Provide bounded, cancellable snapshot collection suitable for periodic UI refresh.
- Represent unsupported, temporarily unavailable, and stale measurements explicitly. Metrics failure must never interrupt playback.
- Keep content IDs, stream URLs, VPN keys, and arbitrary Docker output out of logs and diagnostics.
Acceptance criteria
- The API reports session statistics and runtime metrics with clear units and timestamps.
- Collection tolerates engine startup, shutdown, replacement, and temporary API failures.
- Collection cannot target an unrelated container and has bounded frequency and overhead.
- Tests cover HTTP and Docker metric parsing, unavailable fields, stale data, cancellation, and exact process arguments.
- Docker network I/O is never exposed as peer upload/download.
Non-goals
- Setting resource or bandwidth limits.
- Rendering statistics in the macOS application.
Consumer
AceStreamPlayer #3 will present these metrics.
Goal
Expose safe, typed measurements of the managed engine's P2P activity and computer-resource use.
Scope
SessionStatisticsfor status, active peers, download/upload rates, and downloaded/uploaded totals from the validated Ace Stream session statistics endpoint.EngineRuntimeMetricsfor container state, uptime, CPU usage, memory usage/limit, process count, and cache usage/configured limit.Processargument arrays; never execute a shell or accept arbitrary container names or Docker arguments.Acceptance criteria
Non-goals
Consumer
AceStreamPlayer #3 will present these metrics.