{% from "macros.html" import icon %} {# Queue health chips. The bar chart lives in the sidebar (one sparkline per queue, shared scale) - in here it's just the headline numbers. Latency leads: depth says how much is queued, latency says how far behind we are. Failed renders only when nonzero, so color always means a problem. #}
{{ icon('clock', 'w-3.5 h-3.5') }} latency {{ m.latency|dur if m.latency else '0ms' }} {% if m.cap %} {# The cap sits next to the number it explains. Full is intended behavior, so it stays neutral: only workers that DISAGREE on the cap are a problem. The chip's own text carries the state; the tip only adds to it, and is repeated for screen readers. Not focusable, like every chip here: this region is swapped whole on refresh, which would drop the focus. #} {% set cap_tip = { "mixed": "Workers disagree on global_concurrency. Each enforces its own value, so the queue has no single cap. Give every worker the same one.", "full": "The cap is full. These jobs wait on a free slot, not on a worker, so latency grows by design.", "open": "Jobs active at once across every worker, against the queue-wide cap.", }[m.cap.state] %} {% if m.cap.state == "mixed" %} cap mixed {% for v in m.cap.caps %}{{ v or 'none' }}{{ ', ' if not loop.last }}{% endfor %} {% elif m.cap.state == "full" %} at cap {{ m.cap.active }}/{{ m.cap.limit }} · {{ m.cap.waiting|compact }} waiting {% else %} cap {{ m.cap.active }}/{{ m.cap.limit }} {% endif %} {{ cap_tip }} {% endif %} {{ m.completed|compact }} done {% if m.failed %} {{ m.failed|compact }} failed · {{ m.fail_pct }}% {% endif %} {% if m.percentiles.p95 %} p50 {{ m.percentiles.p50|dur }} · p95 {{ m.percentiles.p95|dur }} {% endif %} last {{ m.minutes }}m