ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
telemetry.h File Reference

Zero-heap sample aggregation (PROTOCORE_ENABLE_TELEMETRY): a moving window, a rate, a totalizer. More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

Zero-heap sample aggregation (PROTOCORE_ENABLE_TELEMETRY): a moving window, a rate, a totalizer.

No external specification governs this module. The three accumulators are ordinary descriptive statistics and numeric integration over caller-owned records, and every name here is this library's own.

  • ::TelemetryWindow the arithmetic mean, the population variance, the standard deviation, the minimum and the maximum of the last cap samples. The mean and the variance come off running sums, so a push and either read are each a fixed number of operations; the minimum and the maximum scan the samples held.
  • ::TelemetryRate the first difference between successive samples, in units per second.
  • ::TelemetryTotalizer the trapezoidal integral of a rate over time. Its value is the quantity SenML names Sum (RFC 8428 sec 4.2, label "s" in sec 4.3 Table 1): the integrated sum of the values over time, in the Unit multiplied by seconds.

The caller owns every byte: the window's sample array is a float array it passes in, and the three accumulator records are its own. Nothing here allocates, and the module keeps no file-scope state.

Elapsed time is the unsigned difference of a monotonic millisecond count, so a counter rollover subtracts correctly.

The module exports one symbol, Telemetry. Everything in telemetry.c has internal linkage.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file telemetry.h.