Skip to content

feat(nest-profiler): rework the profiler UI into sidebar views with a configurable Summary - #186

Draft
fpasquet wants to merge 1 commit into
mainfrom
feat/profiler-ui-summary
Draft

feat(nest-profiler): rework the profiler UI into sidebar views with a configurable Summary#186
fpasquet wants to merge 1 commit into
mainfrom
feat/profiler-ui-summary

Conversation

@fpasquet

@fpasquet fpasquet commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Reworks the profiler home page (GET /_profiler) into a navigable workspace and adds the missing Summary dashboard, implementing epic #146 in full.

  • Two-column layout + sidebar views — the home page adopts the detail page's sticky left sidebar + right content pane. The active view is selected server-side from a ?view= query param (plain links, no client JS, consistent with the script-src 'self' CSP).
  • ViewsSummary (new default), Profiling (the existing per-entrypoint list sections and filters), and one entry per registered global-scope collector (Config, Routes, Schemas…), each built lazily only when active.
  • Summary dashboard — aggregated overview of the recent window: total requests, median (p50) latency with p95 / p99, error rate + count, method / status-class / entrypoint-kind distributions, per performance-tag issue counts, slowest endpoints and recent errors. Computed on demand by a new SummaryService from a single bounded, index-only querySummaries read (never a full-store scan), memoized ~30s. Cards and rows link through to the Profiling filters.
  • Enrichment — a throughput/latency time-series, a process-heap trend chart (moved here from the Profiling list), a performance-issues breakdown (for each tag, the affected endpoints with their entrypoint kind and mean duration, each linking to a representative profile), and a JSON export at GET /_profiler/summary.json.
  • Extensible from any collector — any collector (built-in, package, or a user's custom one) can contribute a tile or table to the Summary via buildSummary(profiles, context?), returning a CollectorSummarySection with tiles and/or a custom EJS table. Contributions are isolated and priority-ordered. The query collectors ship a Database section (query count, average query time, a linked slowest-queries table) and @eleven-labs/nest-profiler-cache ships a Cache section (hit rate, hits, misses).
  • Configurable — the summary module option sets the aggregation window (windowSize), cache TTL (cacheTtl), the per-table row cap (topN, default 5 — tables are labelled "Top N …" with a "View all →" link and show a time column), and how a failure is qualified (error). The error default stays 5xx-or-exception (so 4xx like 401/404 are not counted); it can override the HTTP status bound, toggle whether exceptions count, and add a classify predicate to qualify kinds without a status code (commands, GraphQL, RabbitMQ) from their own tags/attributes.
  • Entrypoint-agnostic — HTTP requests group by their matched route (or method + URL); non-HTTP kinds (CLI commands, RabbitMQ messages, GraphQL operations) group by their own descriptor, so they get a meaningful label (CLI / RMQ / GQL) instead of a blank row.
  • StorageProfileSummary gains an optional route and heapUsed; adapters gain an optional querySummaries(query) returning only lightweight summary rows (native on file + SQLite, in-memory fallback). New public exports include SummaryService, computeProfilerSummary, resolveErrorClassifier, defaultIsError, and the ProfilerSummary / CollectorSummarySection / SummaryContext / ProfilerErrorClassification / ProfileErrorInfo types.

Related issue

Closes #146

Checklist

  • Tests were added or updated to cover the change
  • Documentation was added or updated
  • A changeset was added, or this PR does not affect published packages
  • Breaking changes use a major changeset with a BREAKING: note

Breaking changes

  • This PR includes breaking changes

Additive only — new optional fields/methods, options and exports; no public API removed. SQLite gains route / heap_used columns via idempotent migrations. The collector buildSummary gains an optional context argument (backward-compatible).

@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nest-profiler Ready Ready Preview, Comment Jul 13, 2026 9:15pm
nest-profiler-example Ready Ready Preview, Comment Jul 13, 2026 9:15pm

@github-actions github-actions Bot added scope: packages Change to a publishable package scope: examples Change to example applications package: nest-profiler Affects the @eleven-labs/nest-profiler package labels Jul 12, 2026
@fpasquet
fpasquet force-pushed the feat/profiler-ui-summary branch from 8feb2f8 to 65b4d0f Compare July 13, 2026 20:49
@github-actions github-actions Bot added package: nest-profiler-cache Affects the @eleven-labs/nest-profiler-cache package package: nest-profiler-mongoose Affects the @eleven-labs/nest-profiler-mongoose package labels Jul 13, 2026
@fpasquet fpasquet changed the title feat(nest-profiler): rework the home page with a Summary dashboard feat(nest-profiler): rework the profiler UI into sidebar views with a configurable Summary Jul 13, 2026
@fpasquet
fpasquet force-pushed the feat/profiler-ui-summary branch from 65b4d0f to 0246529 Compare July 13, 2026 20:59
@github-actions github-actions Bot added the package: nest-profiler-routes Affects the @eleven-labs/nest-profiler-routes package label Jul 13, 2026
… configurable Summary

- rework the home page into the detail page's two-column layout with a sticky sidebar of views
- select the active view server-side from a `?view=` param (plain links, no client JS, CSP-safe)
- promote each global-scope collector panel to a lazily-built sidebar view
- add a Summary dashboard as the default view, from a bounded index-only `querySummaries` read
- report requests, median/p95/p99 latency, error rate, and method/status/kind distributions
- add a throughput/latency time-series, a process-heap trend, and N+1-to-endpoint correlation
- break down each performance issue by endpoint, each deep-linking to the profile's relevant tab
- let any collector (built-in, package or custom) contribute a tile or table via `buildSummary`
- ship Database (query count, average time, linked slowest-queries) and Cache (hit rate) sections
- make tables a configurable top-N (default 5, "View all" links) with a time column on each
- make failure qualification configurable via `summary.error` (status bound, exceptions, classifier)
- keep the default of 5xx-or-exception so 4xx like 401/404 are not counted
- add `route`/`heapUsed` to the summary index and a JSON export at `GET /_profiler/summary.json`
- document the Summary view and options, add a changeset, and align the example-api e2e wording
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: nest-profiler Affects the @eleven-labs/nest-profiler package package: nest-profiler-cache Affects the @eleven-labs/nest-profiler-cache package package: nest-profiler-mongoose Affects the @eleven-labs/nest-profiler-mongoose package package: nest-profiler-routes Affects the @eleven-labs/nest-profiler-routes package scope: examples Change to example applications scope: packages Change to a publishable package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: profiler Summary — a slim global overview plus per-page tiles

1 participant