Skip to main content

Module diagnostics

Module diagnostics 

Source
Expand description

Consolidated diagnostics snapshots for feeds and the runtime.

The library exposes several independent observability surfaces: FeedMetrics, QueueTelemetry, DecodeStatus, health events, BatchMetrics, and per-frame Provenance. Each serves a specific purpose, but downstream systems that want a comprehensive view of runtime state must stitch them together manually.

This module provides composite snapshot types that unify the most commonly needed diagnostics into single, coherent reads:

┌──────────────────┐
│ Dashboard / OPS  │
└──────┬───────────┘
       │ poll every 1–5 s
       ▼
  runtime.diagnostics()
       │
       ├─▶ RuntimeDiagnostics
       │     .uptime
       │     .feed_count / .max_feeds
       │     .output_lag  (in_lag, pending_lost)
       │     .batches: Vec<BatchDiagnostics>
       │         .processor_id, .metrics
       │     .feeds: Vec<FeedDiagnostics>  (sorted by FeedId)
       │         .alive / .paused / .uptime
       │         .metrics  (frames counters, restarts)
       │         .queues   (source/sink depth + capacity)
       │         .decode   (hw/sw codec status)
       │         .view     (stability score, context status)
       │         .batch_processor_id  (links to .batches)
       │
       │  (complement with event-driven streams:)
       │
  runtime.health_subscribe()   ← state transitions, errors, degradation
  runtime.output_subscribe()   ← per-frame provenance, admission, detections

The snapshot approach is intentionally poll-oriented. Snapshots are cheap (atomic loads plus small allocations for the Vec and decode detail String), idempotent, and do not perturb the pipeline. Event-driven details (individual health events, per-frame provenance) remain on their respective broadcast channels.

Structs§

BatchDiagnostics
Diagnostics snapshot for a batch coordinator.
FeedDiagnostics
Consolidated per-feed diagnostics snapshot.
OutputLagStatus
Snapshot of the output broadcast channel’s saturation state.
RuntimeDiagnostics
Consolidated runtime-wide diagnostics snapshot.
ViewDiagnostics
Summary of the camera view-system’s current health.

Enums§

ViewStatus
High-level camera view health.