libSDRForge
Loading...
Searching...
No Matches
sdrforge.diagnostics.performance.DspPerformanceMonitor Class Reference

Measure DSP work against RF block duration, excluding startup for steady rate. More...

Public Member Functions

None __init__ (self, *, int sample_rate_hz=2_400_000, float warmup_seconds=5.0, int recent_blocks=64, Callable[[], float] clock=time.perf_counter)
 Initialize the instance.
None record (self, *, int samples, float dsp_seconds, float|None completed_at=None)
 Record the component.
DspPerformanceSnapshot snapshot (self)
 Return the snapshot.

Public Attributes

 sample_rate_hz = sample_rate_hz
 warmup_seconds = warmup_seconds

Protected Attributes

 _clock = clock
 _start = clock()
deque[tuple[float, float]] _recent = deque(maxlen=recent_blocks)
int _blocks = 0
int _samples = 0
float _dsp_s = 0.0
float _rf_s = 0.0
float _max_s = 0.0
int _over_budget = 0
float|None _steady_start = None
int _steady_samples = 0
float _steady_rf_s = 0.0
int _steady_blocks = 0

Detailed Description

Measure DSP work against RF block duration, excluding startup for steady rate.

The steady rate uses a wall-clock window starting after warmup_seconds; it is not a tuner sample-rate measurement. RF rate is measured from the sum of input block durations, while processing rate uses wall time.

Constructor & Destructor Documentation

◆ __init__()

None sdrforge.diagnostics.performance.DspPerformanceMonitor.__init__ ( self,
* ,
int sample_rate_hz = 2_400_000,
float warmup_seconds = 5.0,
int recent_blocks = 64,
Callable[[], float] clock = time.perf_counter )

Initialize the instance.

Parameters
selfThe current instance.
sample_rate_hzThe sample_rate_hz value.
warmup_secondsThe warmup_seconds value.
recent_blocksThe recent_blocks value.
clockThe clock value.

Member Function Documentation

◆ record()

None sdrforge.diagnostics.performance.DspPerformanceMonitor.record ( self,
* ,
int samples,
float dsp_seconds,
float | None completed_at = None )

Record the component.

Parameters
selfThe current instance.
samplesThe samples value.
dsp_secondsThe dsp_seconds value.
completed_atThe completed_at value.

◆ snapshot()

DspPerformanceSnapshot sdrforge.diagnostics.performance.DspPerformanceMonitor.snapshot ( self)

Return the snapshot.

Parameters
selfThe current instance.
Returns
The operation result.

Member Data Documentation

◆ _blocks

int sdrforge.diagnostics.performance.DspPerformanceMonitor._blocks = 0
protected

◆ _clock

sdrforge.diagnostics.performance.DspPerformanceMonitor._clock = clock
protected

◆ _dsp_s

float sdrforge.diagnostics.performance.DspPerformanceMonitor._dsp_s = 0.0
protected

◆ _max_s

float sdrforge.diagnostics.performance.DspPerformanceMonitor._max_s = 0.0
protected

◆ _over_budget

int sdrforge.diagnostics.performance.DspPerformanceMonitor._over_budget = 0
protected

◆ _recent

deque[tuple[float, float]] sdrforge.diagnostics.performance.DspPerformanceMonitor._recent = deque(maxlen=recent_blocks)
protected

◆ _rf_s

float sdrforge.diagnostics.performance.DspPerformanceMonitor._rf_s = 0.0
protected

◆ _samples

int sdrforge.diagnostics.performance.DspPerformanceMonitor._samples = 0
protected

◆ _start

sdrforge.diagnostics.performance.DspPerformanceMonitor._start = clock()
protected

◆ _steady_blocks

int sdrforge.diagnostics.performance.DspPerformanceMonitor._steady_blocks = 0
protected

◆ _steady_rf_s

float sdrforge.diagnostics.performance.DspPerformanceMonitor._steady_rf_s = 0.0
protected

◆ _steady_samples

int sdrforge.diagnostics.performance.DspPerformanceMonitor._steady_samples = 0
protected

◆ _steady_start

float | None sdrforge.diagnostics.performance.DspPerformanceMonitor._steady_start = None
protected

◆ sample_rate_hz

sdrforge.diagnostics.performance.DspPerformanceMonitor.sample_rate_hz = sample_rate_hz

◆ warmup_seconds

sdrforge.diagnostics.performance.DspPerformanceMonitor.warmup_seconds = warmup_seconds

The documentation for this class was generated from the following file: