v0.5: WebRTC unified stats endpoint GET /api/v3/webrtc/stats #24

Open
opened 2026-05-10 21:03:05 -04:00 by zgaetano · 0 comments
Owner

Summary

The existing admin endpoints expose per-stream peer lists. There is no single JSON endpoint that gives an operator a quick health snapshot: active streams, total subscribers, active publishers, UDP ports in use.

Acceptance criteria

  • Add GET /api/v3/webrtc/stats to the WHEP handler's Register() (or a new AdminHandler)
  • Response JSON:
    {
      "active_streams": 3,
      "active_peers": 7,
      "active_publishers": 1,
      "udp_ports_in_use": 6
    }
    
  • WHIPHandler.PublisherCount() — atomic read of active publisher count
  • Wire WHIPHandler reference into Handler so the stats handler can pull both counts
  • Tests: returns 200 + correct JSON shape; counts change after Unpublish
## Summary The existing admin endpoints expose per-stream peer lists. There is no single JSON endpoint that gives an operator a quick health snapshot: active streams, total subscribers, active publishers, UDP ports in use. ## Acceptance criteria - Add `GET /api/v3/webrtc/stats` to the WHEP handler's `Register()` (or a new AdminHandler) - Response JSON: ```json { "active_streams": 3, "active_peers": 7, "active_publishers": 1, "udp_ports_in_use": 6 } ``` - `WHIPHandler.PublisherCount()` — atomic read of active publisher count - Wire `WHIPHandler` reference into `Handler` so the stats handler can pull both counts - Tests: returns 200 + correct JSON shape; counts change after Unpublish
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: zgaetano/datarhei-dragonfork-core#24
No description provided.