Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
live_dsp_telemetry_json.hpp File Reference

Snapshot → JSON serializer for the live per-node DSP telemetry surface. More...

#include <pulp/audio/live_dsp_telemetry.hpp>
#include <string>

Go to the source code of this file.

Namespaces

namespace  pulp
namespace  pulp::audio

Functions

std::string pulp::audio::live_dsp_telemetry_snapshot_to_json (const LiveDspTelemetrySnapshot &snapshot, bool pretty=true)
 Serialize a live-DSP telemetry snapshot to a flat JSON object string.

Detailed Description

Snapshot → JSON serializer for the live per-node DSP telemetry surface.

The live-DSP telemetry store (pulp::audio::LiveDspTelemetryStore) publishes a LiveDspTelemetrySnapshot that the GPU Audio Inspector paints as an overlay. Agents and CI have no window — they need the same scalar facts as text. This helper turns a snapshot into a stable, flat JSON object so a headless caller can dump the live-DSP state after a run.

Pure and allocation-tolerant: it runs on the NON-RT side (after drain() has published), never on the audio thread. Factored out of the inspector so it can be unit-tested without a GPU surface or an audio device.

Time convention: all *_ns fields are nanoseconds (integers). Percentiles (p50/p95/p99) and jitter_ns (p95 − p50) come straight from the snapshot's rolling window. graph_load is a 0..1 fraction of the block budget; it can exceed 1.0 when the graph overruns.