Skip to main content

get_queue_statistics

SQL 0.1.1 · Source cbff27b8a34e1384384018680e46c20d5c610cc9.

Signature​

postgremq.get_queue_statistics(p_queue character varying DEFAULT NULL::character varying)
RETURNS TABLE(pending_count bigint, processing_count bigint, completed_count bigint, total_count bigint)

The signature, defaults, and result above were extracted from the installed PostgreSQL catalog.

Count raw delivery states​

Returns pending, processing, completed, and total delivery-row counts for one queue. Omitted or NULL queue aggregates every queue. DLQ entries are not included. Counts describe stored status, not immediate claimability.

Transactions and errors​

Read-only. A missing queue yields zero counts rather than PMQ02. Expired processing rows remain processing in this view until an operation changes state.

All calls require the applicable caller privileges. See SQL errors for driver failures and uncertain outcomes.

Example​

SELECT * FROM postgremq.get_queue_statistics();
SELECT * FROM postgremq.get_queue_statistics('reference-jobs');

Use queue_metrics for ready, delayed, exhausted, and expired-queue interpretation.

Related: Monitoring, SQL conventions.