{# queue/_live.html — the sections the live stream replaces wholesale. Rendered on the page and, identically, inside every `queue.status` frame: the same template, the same report. #} {% from "mirrorwall/components.html" import badge, empty_state, kv_list, table %} {{ kv_list([ {"label": "Active jobs", "value": report.active ~ " of at most " ~ report.max_depth}, {"label": "By state", "value": (report.depth_by_state | tojson) if report.depth_by_state else "empty"}, {"label": "By class", "value": (report.depth_by_class | tojson) if report.depth_by_class else "empty"}, {"label": "Oldest queued", "value": (report.oldest_queued_age_seconds | round(1) ~ " s") if report.oldest_queued_age_seconds is not none else "—"}, {"label": "Starving", "value": report.starving}, {"label": "Completed, last 5 min", "value": report.throughput.completed_last_5m}, {"label": "Dispatch latency", "value": (report.dispatch_latency_ms.median | round(1) ~ " ms median, " ~ report.dispatch_latency_ms.max | round(1) ~ " ms max over " ~ report.dispatch_latency_ms.samples ~ " claims") if report.dispatch_latency_ms and report.dispatch_latency_ms.samples else "no claim yet"}, {"label": "Dispatch", "value": (badge("paused", tone="warning") if report.flags.paused else badge("draining", tone="warning") if report.flags.draining else badge("running", tone="success")) | safe}, {"label": "Last recovery", "value": (report.last_recovery.touched ~ " job(s) reconciled") if report.last_recovery else "—"}, ]) }}

Executing now

{% if report.executions %} {% set columns = [{"label": "Job"}, {"label": "Worker"}, {"label": "State"}, {"label": "Class"}, {"label": "Model"}, {"label": "GPU"}] %} {% set rows = [] %} {% for entry in report.executions %} {% set _ = rows.append([ ('' ~ entry.job_id ~ "") | safe, entry.worker, entry.state, entry["class"], entry.canonical_id or "—", entry.target_gpu_index if entry.target_gpu_index is not none else "—" ]) %} {% endfor %} {{ table(columns, rows, caption="Jobs a worker of this process holds.", table_id="executions", complete=true, row_count=report.executions | length) }} {% else %} {{ empty_state("No job is executing.") }} {% endif %}

Resident models

{% if report.residency %} {% set columns = [{"label": "Model"}, {"label": "GPU", "numeric": true}, {"label": "VRAM"}, {"label": "Idle", "numeric": true}, {"label": "Loaded"}] %} {% set rows = [] %} {% for row in report.residency %} {% set _ = rows.append([ row.canonical_id, row.gpu_index, (row.vram_bytes | bytes_human) if row.vram_bytes is not none else (row.vram_bytes_unavailable_reason or "unknown"), row.idle_seconds | round(0) ~ " s", row.loaded_at ]) %} {% endfor %} {{ table(columns, rows, caption="Per device; max_resident_models applies per device.", table_id="residency", complete=true, row_count=report.residency | length) }} {% else %} {{ empty_state("Nothing is resident, or the provider cannot report residency.") }} {% endif %}

Circuit breakers

{% if report.circuit_breakers %} {% set columns = [{"label": "Model"}, {"label": "State"}, {"label": "Failure rate", "numeric": true}, {"label": "Samples", "numeric": true}, {"label": "Reason"}] %} {% set rows = [] %} {% for breaker in report.circuit_breakers %} {% set _ = rows.append([ breaker.canonical_id, badge(breaker.state, tone="danger" if breaker.state == "open" else "warning" if breaker.state == "half_open" else "success"), ("%.0f%%" | format(breaker.failure_rate * 100)) if breaker.failure_rate is not none else "—", breaker.samples, breaker.reason ]) %} {% endfor %} {{ table(columns, rows, caption="A model that keeps failing is excluded until its cool-down, then re-probed.", table_id="breakers", complete=true, row_count=report.circuit_breakers | length) }} {% else %} {{ empty_state("No model has failed recently.") }} {% endif %}