You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(webapp): make the Queues hero charts environment-wide
The four charts above the queues table reused the loader's already-paginated
queue array as a ClickHouse `queue IN (...)` filter, so they aggregated over at
most the 25 queues on the current page. Paging or re-sorting changed the values,
and a name search that matched nothing blanked the whole chart row.
They now read `env_metrics`, the environment-level rollup that already exists
for this (the built-in Queues dashboard and the health report read it), which is
both correct and queue-count-independent: no `GROUP BY queue` across an entire
environment and no client-side summing.
Two related fixes ride along:
Scheduling delay and throttling are event-driven, so at the 10-second bucket a
short range picks, most buckets hold no samples at all and were drawn as 0ms —
measured at 232 of 349 buckets over an hour. TRQL grows a `minBucketSeconds`
floor, plumbed through the metric resource route, and the hero tiles set 60s
(one floor for all four, since the shared hover crosshair needs identical
x-axes). Buckets that still have no samples now render as a gap rather than a
dive to zero. Note that `wait_ms_count` only counts `wait_ms > 0`, so "nothing
started" and "everything started instantly" are indistinguishable in storage;
both read as a gap.
Recharts was resolving victory-vendor's CJS entry on the server and its ESM
entry in the browser. Those bundle different d3-shape builds — the CJS one
predates d3-path's digit rounding — so every server-rendered curve carried
full-precision coordinates while the client rounded to 3 decimals, and React
reported a hydration mismatch on every chart. Bundling recharts for SSR makes
both sides resolve the same ESM build.
The four charts at the top of the Queues page now always cover the whole environment, so paging through or re-sorting your queues no longer changes them. The scheduling delay chart also leaves a gap where no runs started, instead of dropping to zero.
// Numerator: running summed across the visible set. Denominator: the env-wide limit (same for
1301
-
// every queue in a bucket), so the line reads as the set's share of the environment capacity.
1302
-
query: `SELECT timeBucket() AS t,\n queue,\n max(max_running) AS running,\n max(max_env_limit) AS env_limit\nFROM queue_metrics\nGROUP BY t, queue\nORDER BY t`,
1263
+
query: `SELECT timeBucket() AS t,\n max(max_env_running) AS running,\n max(max_env_limit) AS env_limit\nFROM env_metrics\nGROUP BY t\nORDER BY t`,
1303
1264
formatValue: (v)=>(v>100 ? `${v}% — over the environment limit` : `${v}%`),
// quantilesMerge over the set's rows in a bucket is the true p95 across the union of samples
1347
-
// (merging quantile states is valid; averaging per-queue percentiles would not be).
1348
-
query: `SELECT timeBucket() AS t,\n round(quantilesMerge(0.5, 0.9, 0.95, 0.99)(wait_quantiles)[3]) AS p95\nFROM queue_metrics\nGROUP BY t\nORDER BY t`,
1306
+
query: `SELECT timeBucket() AS t,\n round(quantilesTDigestMerge(0.5, 0.9, 0.95, 0.99)(wait_quantiles)[3]) AS p95,\n sum(wait_ms_count) AS samples\nFROM env_metrics\nGROUP BY t\nORDER BY t`,
0 commit comments