Skip to content

feat: connections + sessions summary endpoints (Phase 4 + 5 of #20)#27

Open
Boanerges1996 wants to merge 2 commits intopeermetrics:masterfrom
Boanerges1996:feat/connections-sessions-summary-phase4-5
Open

feat: connections + sessions summary endpoints (Phase 4 + 5 of #20)#27
Boanerges1996 wants to merge 2 commits intopeermetrics:masterfrom
Boanerges1996:feat/connections-sessions-summary-phase4-5

Conversation

@Boanerges1996
Copy link
Copy Markdown
Contributor

Summary

Stacked on top of #26 — this PR will show both Phase 2+3 and Phase 4+5 commits until #26 merges, at which point it will rebase down to just the Phase 4+5 commit. Reviewers can focus on `7cd2ec4`.

Adds the final three aggregation endpoints so the dashboard charts are fully server-side:

  • `GET /v1/connections/summary` — relay vs direct connection counts (powers Relayed-connections pie chart)
  • `GET /v1/connections/setup-time-summary` — connection setup-time buckets (< 250 ms → > 5000 ms), each bucket includes `conference_ids` so the click-to-detail modal can page through matching conferences without re-running the aggregation
  • `GET /v1/sessions/summary` — browsers / OS / country / city (lat-lon-count) aggregates (powers Browsers, Operating systems, and Map charts)

Also extends `/conferences` with `?conference_ids=a,b,c` so the setup-time chart can fetch matching conferences on click via `id__in`.

With this merged, every chart on the graphs tab reads a server-side aggregate. No more full-table downloads to the browser.

Test plan

  • Smoke each endpoint and confirm totals match equivalent raw-table aggregation
  • Click a setup-time bucket in the UI and confirm matched conferences open in the modal
  • Confirm `conference_ids=` filter on `/conferences` returns exactly the requested rows

🤖 Generated with Claude Code

Boanerges1996 and others added 2 commits April 20, 2026 21:47
Five new endpoints for the remaining dashboard charts that fetch raw data:

- GET /v1/conferences/duration-summary
    Returns conference counts bucketed by duration range (< 1m, 1-3m, etc.)
- GET /v1/conferences/participant-count-summary
    Returns distribution of conferences by participant count
- GET /v1/issues/summary
    Returns issue counts grouped by code with titles
- GET /v1/issues/gum-summary
    Returns getusermedia_error issue counts grouped by error name

Also adds three new filter params to /v1/conferences for click-to-detail
modals on these charts:
- duration_gte, duration_lt (for duration chart)
- issue_code (for most-common-issues chart)

All endpoints accept appId, created_at_gte, created_at_lte and handle
both Python native ISO format and JavaScript's toISOString Z suffix.

Phases 2 and 3 of peermetrics#20 — eliminates the need for the dashboard to
download all conferences (~38MB) and all issues (~73MB).
…ermetrics#20)

Adds three new aggregation endpoints that let the dashboard stop
downloading full /connections and /sessions payloads to build charts
client-side:

- GET /v1/connections/summary — relay vs direct connection counts
  (replaces the Relayed-connections pie chart's client-side reduce)
- GET /v1/connections/setup-time-summary — connection setup-time
  buckets with per-bucket conference_ids for click-to-detail
- GET /v1/sessions/summary — browsers, OS, country, and city/geo
  aggregates (powers Browsers, OS, and Map charts in one roundtrip)

Also accepts `conference_ids=a,b,c` on /conferences so the setup-time
chart can page through matched conferences on click.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant