You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support a decdn node top subcommand that polls /metrics every second and renders a live terminal table of active streams, bytes served, and cache hit rate #275
Real-time visibility into node activity is currently only possible by scraping /metrics with an external tool; a built-in live view similar to htop would lower the barrier for operators running nodes without a Prometheus/Grafana stack.
Audited the metrics and serving path against this issue's three columns. Two of the three don't exist yet:
Issue asks for
Status today
active streams
Closest is decdn_dispatch_in_flight (crates/node/src/metrics.rs:65) — counts QUIC handler tasks, not per-blob streams. Reasonable approximation.
bytes served
❌ No counter exists. The cache crate (crates/cache/src/) emits zero metrics, and there is no cdn/client/v1 serving handler — only cdn/probe/v1 is wired up in crates/node/src/runtime/mod.rs:121. Nothing is currently streaming bytes to clients to instrument.
cache hit rate
❌ No cache_hits_total / cache_misses_total. Cache hit/miss happens inside CacheEngine::pull_through but is not surfaced to decdn_* metrics.
Prerequisite work
In rough dependency order:
Cache hit/miss counters. Plumb a metrics handle into CacheEngine without making cache depend on node (per decdn/CLAUDE.md's leaf-crate rule — likely a small trait or Fn callback in the cache crate, with the node wiring layer providing the impl).
cdn/client/v1 serving handler. A meaningful "bytes served" only exists once there's a paid-delivery path to instrument. This is core CDN work, well beyond the scope of a node top CLI.
Bytes-served counter in that handler (cumulative Counter, with the TUI computing per-second deltas client-side).
After 1–3 land, the original issue collapses to ~M effort: parse OpenMetrics text from /metrics, render with ratatui or simpler ANSI redraw, compute deltas between ticks.
Recommendations
Mark blocked until the serving path + metrics land.
Optionally split: file separate issues for "cache hit/miss metrics" and "bytes-served counter on serving handler" so each prereq is independently trackable.
If a narrower live-view is wanted now, scope it to currently-available metrics (active_connections, dispatch_in_flight, gossip_peer_table_size, uptime_seconds, rpc_healthy, gossip rates) and rename the issue accordingly — but that's a different feature than what the title describes.
Filed cache instrumentation prereq as #418 (hit/miss + bytes-from-cache counters). Combined with #317 (network-side serving handler), those are the two upstream blockers for this issue.
Unblocked by #421 (merged in #425, commit ea01130). The new shape is decdn node top (the node admin namespace now lives on the user CLI, not the daemon). No rewrite of this issue's design needed — only the binary placement question is resolved. The work is the metrics renderer.
Activity
thiras commentedon May 6, 2026
Prerequisite gap — not actionable as written
Audited the metrics and serving path against this issue's three columns. Two of the three don't exist yet:
decdn_dispatch_in_flight(crates/node/src/metrics.rs:65) — counts QUIC handler tasks, not per-blob streams. Reasonable approximation.crates/cache/src/) emits zero metrics, and there is nocdn/client/v1serving handler — onlycdn/probe/v1is wired up incrates/node/src/runtime/mod.rs:121. Nothing is currently streaming bytes to clients to instrument.cache_hits_total/cache_misses_total. Cache hit/miss happens insideCacheEngine::pull_throughbut is not surfaced todecdn_*metrics.Prerequisite work
In rough dependency order:
CacheEnginewithout makingcachedepend onnode(perdecdn/CLAUDE.md's leaf-crate rule — likely a small trait orFncallback in the cache crate, with thenodewiring layer providing the impl).cdn/client/v1serving handler. A meaningful "bytes served" only exists once there's a paid-delivery path to instrument. This is core CDN work, well beyond the scope of anode topCLI.Counter, with the TUI computing per-second deltas client-side).After 1–3 land, the original issue collapses to ~M effort: parse OpenMetrics text from
/metrics, render withratatuior simpler ANSI redraw, compute deltas between ticks.Recommendations
blockeduntil the serving path + metrics land.active_connections,dispatch_in_flight,gossip_peer_table_size,uptime_seconds,rpc_healthy, gossip rates) and rename the issue accordingly — but that's a different feature than what the title describes.thiras commentedon May 6, 2026
Filed cache instrumentation prereq as #418 (hit/miss + bytes-from-cache counters). Combined with #317 (network-side serving handler), those are the two upstream blockers for this issue.
thiras commentedon May 6, 2026
Unblocked by #421 (merged in #425, commit ea01130). The new shape is
decdn node top(thenodeadmin namespace now lives on the user CLI, not the daemon). No rewrite of this issue's design needed — only the binary placement question is resolved. The work is the metrics renderer.fix(cli): use Duration::from_secs(1) for clippy 1.95 (#275)
fix(cli): normalize --metrics-url + propagate JoinError in 503 test (#…
feat(cli): scaffold decdn node top — clap surface + dispatch + reqwes…
feat(cli): parse OpenMetrics text bodies for node top (#275)
feat(cli): Snapshot + delta + hit_rate primitives for node top (#275)
4 remaining items
test(cli): integration test for node top against embedded metrics ser…
fix(cli): bound retries + propagate stdout errors in node top loop (#275
refactor(cli): move node top integration test in-module + revert pub (#…
refactor(cli): hoist ConfigPathSource + drop redundant per_sec suffix (…
test(cli): add wraparound + uptime + config-file tests for node top (#…
fix(cli): use Duration::from_secs(1) for clippy 1.95 (#275)
fix(cli): normalize --metrics-url + propagate JoinError in 503 test (#…
fix(cli): preserve query/fragment in metrics URL + drop brittle test (#…
fix(cli): persistent 4xx fast-fail + classifier rename + comment clea…
test(cli): direct tests for classifier + loop cap + parity (#275)
refactor(cli): re-export ConfigPathSource at decdn_common::cli (#275)
feat(cli): add `decdn node top` live metrics view (#275) (#485)
fix(docs): address review — node top, reputation bullet, CLAUDE bundle
fix(docs): align README crate-structure block with workspace (closes #…