|
ESPectre SDK 2.8.0-280-gac7af68
Wi-Fi CSI motion sensing for ESP32 firmware
|
Converts cumulative diagnostics into rates over the interval between reads. More...
#include <runtime_diagnostics.h>
Public Member Functions | |
| void | reset (const RuntimeDiagnosticsSnapshot &snapshot, uint32_t now_ms) |
| Establish the baseline the next sample() measures against. | |
| RuntimeDiagnosticsSample | sample (const RuntimeDiagnosticsSnapshot &snapshot, uint32_t now_ms) |
| Derive rates since the previous read and adopt this one as the baseline. | |
Converts cumulative diagnostics into rates over the interval between reads.
Call reset() when the owning frontend starts. Counter resets are treated as a new epoch, so rearming a traffic source cannot underflow a rate.
Definition at line 75 of file runtime_diagnostics.h.
| void espectre::RuntimeDiagnosticsSampler::reset | ( | const RuntimeDiagnosticsSnapshot & | snapshot, |
| uint32_t | now_ms ) |
Establish the baseline the next sample() measures against.
| snapshot | Current cumulative counters. |
| now_ms | Monotonic frontend clock, in milliseconds. |
| RuntimeDiagnosticsSample espectre::RuntimeDiagnosticsSampler::sample | ( | const RuntimeDiagnosticsSnapshot & | snapshot, |
| uint32_t | now_ms ) |
Derive rates since the previous read and adopt this one as the baseline.
The caller owns the window. Shipped frontends invoke this from their existing periodic sensing update, so diagnostics do not add a timer.
| snapshot | Current cumulative counters. |
| now_ms | Monotonic frontend clock, in milliseconds. |