Skip to content

release: To Prod#1427

Merged
suisuss merged 6 commits into
prodfrom
staging
Jun 1, 2026
Merged

release: To Prod#1427
suisuss merged 6 commits into
prodfrom
staging

Conversation

@suisuss

@suisuss suisuss commented Jun 1, 2026

Copy link
Copy Markdown

No description provided.

suisuss added 6 commits June 1, 2026 17:22
Gate PRs touching app/api/metrics, lib/metrics, and lib/db/index.ts
(the metricsDb pool concurrency cap) behind a metrics-db-reviewed label
applied by a non-author. Guardrail for the 2026-05-29 DB CPU incident
class, which only manifests at prod data volume.
…-gate

ci: add metrics DB review label gate
Wrap getAnalyticsSummary / getTimeSeries / getNetworkBreakdown in a keyed TTL cache (lib/analytics/cache.ts) so the GET routes and the SSE summary push share one DB round-trip per (org, range, project, window), and widen the SSE checksum poll from 2s to 5s. This collapses the per-viewer summary recompute - including the unindexed JSONB gas scans - that was saturating prod DB CPU.

Scope the runs-table gas/network aggregation to the page's execution IDs instead of the whole org+window slice, so opening the runs table no longer runs the JSONB gas extraction over every row in range.

KEEP-684: analytics read cache + SSE cadence. KEEP-685: page the runs gas aggregation.
cache.ts imports server-only; the package throws when resolved outside a Server Component, so the unit suite must stub it (same pattern as workflow-logging.test.ts).
… runs pagination tiebreak

Only named ranges are keyed into the per-process analytics cache. Custom
ranges carry caller-supplied start/end strings that are effectively
single-use, so keying on them grew the Map without bound (a cheap
memory-pressure vector) for no hit-rate benefit; those now recompute
directly via isCacheableRange.

Add a secondary id key to both the paged-execution-ids subquery and the
outer runs page query so their independent ORDER BY ... LIMIT evaluations
resolve started_at ties to the same rows, preventing a boundary row from
losing its gas aggregation.
perf: cache analytics read paths and page the runs gas aggregation
@suisuss suisuss merged commit bba3eb3 into prod Jun 1, 2026
24 checks passed
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