Skip to content

Commit e87d814

Browse files
ericallamTrigger.dev RepoOps
authored andcommitted
fix(webapp): clearer Queues metrics cards (Allocated and Oldest wait)
Two clarity fixes on the Queues pages. The "Allocated" tile now explains that it is the sum of your queue concurrency limits and how that compares to the environment limit, and no longer shows a warning colour when the total goes over the environment limit (which is expected, since any single queue can burst past it). The queue detail "Oldest wait" card now shows a single clear number with a tooltip, and drops a second "worst" figure that could confusingly read lower than the headline. Mono-RevId: f016b5868e88a675dd636131c552b10fb3993928
1 parent ac47902 commit e87d814

4 files changed

Lines changed: 29 additions & 19 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: fix
4+
---
5+
6+
The queue page's "Oldest wait" card now shows a single clear number (how long the oldest waiting run has been waiting) with an explanatory tooltip, and no longer shows a second "worst" figure that could confusingly read lower than the headline.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
The Queues page Allocated tile now explains that it is the sum of your queue concurrency limits, and no longer shows a warning color when those add up to more than the environment limit, which is expected.

‎apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@ function QueuesWithMetricsView() {
462462
const burstLimit = Math.round(envLimit * environment.burstFactor);
463463
const allocated = allocation?.allocated ?? 0;
464464
const allocationPct = envLimit > 0 ? Math.round((allocated / envLimit) * 100) : 0;
465-
const overAllocated = allocated > envLimit;
466465

467466
// Running-block tinting (burst/limit) tracks the live running value, not the loader snapshot.
468467
const { limitStatus, limitClassName } = getEnvConcurrencyLimitStatus({
@@ -583,17 +582,16 @@ function QueuesWithMetricsView() {
583582
title={
584583
<span className="flex items-center gap-1">
585584
Allocated
586-
{allocation && overAllocated ? (
585+
{allocation ? (
587586
<InfoIconTooltip
588-
content="The queue limits add up to more than the environment limit, so queues will compete for concurrency when the environment saturates."
589-
buttonClassName="text-warning"
587+
content="The sum of every queue's concurrency limit. It can go over 100% of the environment limit, which is normal: it lets one queue burst while others are quiet. The environment limit still caps total running work, so queues share it when the environment is busy."
588+
contentClassName="max-w-xs"
590589
/>
591590
) : null}
592591
</span>
593592
}
594593
value={allocation ? allocated : undefined}
595594
formattedValue={allocation ? undefined : "–"}
596-
valueClassName={cn(allocation && overAllocated && "text-warning")}
597595
suffix={allocation ? `${allocationPct}% of the environment limit` : undefined}
598596
suffixClassName="text-text-dimmed"
599597
/>

‎apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues_.$queueParam/route.tsx‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,18 +1107,12 @@ function QueueStats({
11071107
timeRange: TimeRangeParams;
11081108
queueName: string;
11091109
}) {
1110-
// Live "now" is empty for a queue that just drained, so add the window peak/worst as a dimmed
1111-
// caption (styled like "bursts up to 50" on the Queues list) — a quiet queue still shows how
1112-
// backed up it got recently. "worst_wait" is the window's worst head-of-line wait (max of the
1113-
// oldest still-waiting run's age), the same metric as the live "Oldest wait" headline — not the
1114-
// scheduling-delay percentiles of runs that already started. Only concurrency-keyed queues record
1115-
// this (max_ck_wait_ms), so it's 0/absent for non-keyed queues.
1116-
const { rows } = useQueueMetric(
1117-
`SELECT max(max_queued) AS peak_queued,\n max(max_ck_wait_ms) AS worst_wait\nFROM queue_metrics`,
1118-
{ ids, timeRange, queueName }
1119-
);
1110+
const { rows } = useQueueMetric(`SELECT max(max_queued) AS peak_queued\nFROM queue_metrics`, {
1111+
ids,
1112+
timeRange,
1113+
queueName,
1114+
});
11201115
const peakQueued = rows[0] ? toNumber(rows[0].peak_queued) : 0;
1121-
const worstWaitMs = rows[0] ? toNumber(rows[0].worst_wait) : 0;
11221116

11231117
// Latest gauges from ClickHouse, polled every 15s so the live blocks keep ticking after first
11241118
// paint. Read the newest bucket (largest t); until the first poll lands liveRows is empty and the
@@ -1184,7 +1178,15 @@ function QueueStats({
11841178
}
11851179
/>
11861180
<BigNumber
1187-
title="Oldest wait"
1181+
title={
1182+
<span className="flex items-center gap-1">
1183+
Oldest wait
1184+
<InfoIconTooltip
1185+
content="How long the oldest run currently waiting in this queue has been waiting to start."
1186+
contentClassName="max-w-xs"
1187+
/>
1188+
</span>
1189+
}
11881190
formattedValue={
11891191
oldestWaitDisplayMs !== null && oldestWaitDisplayMs > 0
11901192
? formatWaitMs(oldestWaitDisplayMs)
@@ -1196,8 +1198,6 @@ function QueueStats({
11961198
oldestWaitDisplayMs >= OLDEST_WAIT_WARNING_MS &&
11971199
"text-warning"
11981200
)}
1199-
suffix={worstWaitMs > 0 ? `worst ${formatWaitMs(worstWaitMs)}` : undefined}
1200-
suffixClassName="text-text-dimmed"
12011201
/>
12021202
</MetricsLayout.Grid>
12031203
);

0 commit comments

Comments
 (0)