From 91ea06be79aff5231da620b4364a334e9150bcf7 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 1 Jul 2026 16:01:29 -0400 Subject: [PATCH] feat(agent): Status shows smoothed jobs/min + downloads/min (replace jumpy gauges) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The buffer / on-GPU / downloader counts flip many times a second, so a 3s status poll only ever samples noise — the tiles looked frozen (same value twice) or random (wildly different), reading as "the Status section doesn't update" when the backend was in fact live (operator-flagged 2026-07-01). Replace the three instantaneous gauge tiles with two derived RATE tiles: - jobs / min — GPU throughput, from the monotonic `processed` counter - downloads / min — fetch throughput, from a new monotonic `downloaded` counter (bumped when a job is decoded into the buffer) Together they also show pipeline balance (dl/min > j/min ⇒ GPU-bound; the reverse ⇒ GPU starved). Both are EWMA-smoothed over the poll deltas, clamped at 0 (agent restart resets the counters), and skip a backgrounded-tab gap. The still-useful instantaneous state is demoted, not lost: buffer stays as the occupancy bar; downloaders/consumers/on-GPU move to the sub-line. `waited out` (transient) gets promoted to a tile. backend: worker.status() gains `downloaded`; `_bump(downloaded=)`. frontend: retiled Status + rate math in applyStatus; VERSION → .7. Co-Authored-By: Claude Opus 4.8 (1M context) --- agent/fc_agent/app.py | 40 +++++++++++++++++++++++++++++++--------- agent/fc_agent/worker.py | 9 ++++++++- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/agent/fc_agent/app.py b/agent/fc_agent/app.py index 05a6e2e..2c28e04 100644 --- a/agent/fc_agent/app.py +++ b/agent/fc_agent/app.py @@ -17,7 +17,7 @@ from .worker import Worker # Bump on every agent change. The page embeds this and /status reports it; the UI # warns to reload when they differ — so a stale browser-cached page can't be # mistaken for "the new image didn't deploy". (Belt-and-braces with no-store.) -VERSION = "2026-07-01.6 · stream videos via ffmpeg-from-URL (no full download)" +VERSION = "2026-07-01.7 · status: smoothed jobs/min + downloads/min rates" logbuf.install() cfg = Config.from_env() @@ -218,11 +218,11 @@ _PAGE = """
Status
state
-
0
downloaders
-
buffer
-
0
on GPU
+
jobs / min
+
downloads / min
0
processed
0
errors
+
0
waited out
GPU util
@@ -232,7 +232,7 @@ _PAGE = """
buffer occupancy
-
consumers — · waited out 0
+
downloaders — · consumers — · on GPU 0
queue —
@@ -246,6 +246,11 @@ _PAGE = """