Skip to content

feat: duration/participants/issues/gum summary endpoints (Phase 2 + 3 of #20)#26

Open
Boanerges1996 wants to merge 1 commit intopeermetrics:masterfrom
Boanerges1996:feat/issues-conferences-summary-phase2-3
Open

feat: duration/participants/issues/gum summary endpoints (Phase 2 + 3 of #20)#26
Boanerges1996 wants to merge 1 commit intopeermetrics:masterfrom
Boanerges1996:feat/issues-conferences-summary-phase2-3

Conversation

@Boanerges1996
Copy link
Copy Markdown
Contributor

Summary

  • Three new aggregation endpoints so the dashboard stops downloading full /conferences and /issues payloads:
    • `GET /v1/conferences/duration-summary` — conference duration buckets (< 1 m through > 60 m)
    • `GET /v1/conferences/participant-count-summary` — participant-count distribution (0, 2, 3, …)
    • `GET /v1/issues/summary` — most-common-issues counts, grouped by code
    • `GET /v1/issues/gum-summary` — getUserMedia-error breakdown by error name
  • All endpoints accept the same `appId` / `created_at_gte` / `created_at_lte` filter shape already used by `/conferences/summary`.

Depends on #24 (already merged). Phase 4 + 5 will be a follow-up PR stacked on top of this one.

Test plan

  • Smoke each endpoint against a populated app and confirm the totals match the corresponding full-table COUNTs
  • Confirm `created_at_gte` / `created_at_lte` narrow results correctly
  • Confirm each endpoint returns `{"data": [...]}` (the dashboard client unwraps `data` automatically)

🤖 Generated with Claude Code

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).
@Boanerges1996
Copy link
Copy Markdown
Contributor Author

@codex

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbdd2ebcd4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

'created_at__lte': 'created_at_lte',
'duration__gte': 'duration_gte',
'duration__lt': 'duration_lt',
'issues__code': 'issue_code',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Deduplicate conference rows for issue_code filters

When issue_code is passed, filtering on issues__code performs a reverse join to Issue and returns one Conference row per matching issue, so conferences with multiple matching issues are duplicated in /conferences responses. This causes incorrect pagination and repeated conference IDs in client results; use .distinct() (or an Exists-based predicate) when this filter is active.

Useful? React with 👍 / 👎.

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