Skip to content

[FEAT] Add PR review time histogram — distribution of review durations across all PRs #3245

Description

@Nareshkumawat-star

Is your feature request related to a problem?
The current PRMetrics.tsx shows a single "Avg Review Time" number. A single average hides the real picture — one PR that took 2 weeks skews the average for 20 PRs that were reviewed in an hour.

Describe the solution you'd like
Add a review time histogram below the existing PR stat cards:

  • X-axis buckets: <1h, 1–4h, 4–24h, 1–3d, 3–7d, 7d+
  • Y-axis: number of PRs in each bucket
  • Use Recharts BarChart (already in the dependency tree)
  • Tooltip on hover: "X PRs reviewed within this range"
  • Color-code bars: green for fast, amber for moderate, red for slow

Backend changes
Extend /api/metrics/prs/route.ts to return a reviewTimeBuckets array alongside the existing stats.

Why this matters
This gives a much more actionable view of review bottlenecks than a single average number.

File: src/components/PRMetrics.tsx, src/app/api/metrics/prs/route.ts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleInactive for 21+ days

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions