MeasurementRouter.onLevelMeasurement was writing level samples via .value(value).unit(context.unit), which dropped the timestamp. The level-rate fallback in FlowAggregator derives netFlow from dlevel/dt, so without a timestamp on each sample it had nothing to differentiate. Switch to the positional .value(value, timestamp, unit) form so the fallback works. Add a basic test that drives two level samples 2 s apart and asserts the aggregator produces direction=filling with a finite dlevel/dt-derived netFlow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
28 KiB
28 KiB