Skip to content

Commit b67de1a

Browse files
committed
Versioning dashboard and proxy for release post 12.24
1 parent 54a99e2 commit b67de1a

14 files changed

Lines changed: 252 additions & 172 deletions

File tree

packages/dashboard/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A web-based dashboard for monitoring and managing [pg-boss](https://github.com/t
1818

1919
- Node.js 22.12+
2020
- PostgreSQL database with pg-boss schema
21-
- pg-boss 12.11+
21+
- pg-boss 12.24+ recommended (12.21 minimum; queue metrics history and ready-count sparklines require 12.24)
2222

2323
## Installation
2424

packages/dashboard/app/lib/queries.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const QUEUE_SORT_COLUMNS: Record<string, string> = {
4545
storage: 'partition',
4646
queued: 'queued_count',
4747
deferred: 'deferred_count',
48-
ready: 'GREATEST(queued_count - deferred_count, 0)',
48+
ready: 'ready_count',
4949
active: 'active_count',
5050
failed: 'failed_count',
5151
total: 'total_count',
@@ -97,7 +97,7 @@ const QUEUE_COLUMNS = `
9797
deletion_seconds as "deleteAfterSeconds",
9898
deferred_count as "deferredCount",
9999
queued_count as "queuedCount",
100-
GREATEST(queued_count - deferred_count, 0) as "readyCount",
100+
ready_count as "readyCount",
101101
active_count as "activeCount",
102102
failed_count as "failedCount",
103103
total_count as "totalCount",
@@ -781,7 +781,7 @@ export async function getQueueStats (
781781
SELECT
782782
COALESCE(SUM(deferred_count), 0)::int as "totalDeferred",
783783
COALESCE(SUM(queued_count), 0)::int as "totalQueued",
784-
COALESCE(SUM(GREATEST(queued_count - deferred_count, 0)), 0)::int as "totalReady",
784+
COALESCE(SUM(ready_count), 0)::int as "totalReady",
785785
COALESCE(SUM(active_count), 0)::int as "totalActive",
786786
COALESCE(SUM(failed_count), 0)::int as "totalFailed",
787787
COALESCE(SUM(total_count), 0)::int as "totalJobs",

packages/dashboard/app/lib/types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ export interface QueueResult extends PgBossQueueResult {
2626
maintainOn: Date | null;
2727
// Stats fields (declared locally so the dashboard typechecks against older
2828
// installed pg-boss versions whose published types predate these columns).
29-
// readyCount = queuedCount - deferredCount (jobs runnable now); failedCount =
30-
// failed jobs still retained in the table.
29+
// readyCount = queue.ready_count, the count of jobs runnable now (start_after <= now),
30+
// persisted by pg-boss as GREATEST(queued - deferred, 0) since schema v32 (alongside
31+
// failed_count); failedCount = failed jobs still retained in the table.
3132
readyCount: number;
3233
failedCount: number;
3334
// Sliding window of recent ready counts (newest first) maintained by pg-boss on every monitor

0 commit comments

Comments
 (0)