Queuety
Features

Metrics

Queuety provides a metrics API that computes per-handler statistics from the log table. Use it for monitoring, dashboards, and alerting.

Handler statistics

Get metrics for all handlers within a time window:

$stats = Queuety::metrics()->handler_stats( 60 ); // last 60 minutes

Each entry in the returned array contains:

FieldDescription
handlerHandler name
completedNumber of successful executions
failedNumber of failed executions
avg_msAverage execution duration in milliseconds
p95_ms95th percentile execution duration
error_rateFailure rate as a percentage

CLI

# Metrics for the last 60 minutes (default)
wp queuety metrics

# Metrics for the last 24 hours
wp queuety metrics --minutes=1440

# JSON output
wp queuety metrics --format=json

Example output:

+------------------+-----------+--------+--------+--------+------------+
| handler          | completed | failed | avg_ms | p95_ms | error_rate |
+------------------+-----------+--------+--------+--------+------------+
| send_email       | 142       | 3      | 45     | 120    | 2.07%      |
| process_image    | 87        | 0      | 230    | 450    | 0.00%      |
| call_openai      | 31        | 5      | 2100   | 4500   | 13.89%     |
+------------------+-----------+--------+--------+--------+------------+

Use cases

  • Dashboard widgets. Display throughput and error rates in the WordPress admin.
  • Health checks. Alert when a handler's error rate exceeds a threshold.
  • Performance tuning. Identify slow handlers using p95_ms and optimize them.
  • Capacity planning. Track throughput trends to size your worker pool.

On this page