-
public final class SampleRingBufferThread-safe sliding window of BiosignalSample values. Evicts samples older than windowSec from the most recent sample on each append.
-
-
Constructor Summary
Constructors Constructor Description SampleRingBuffer(Integer windowSec)
-
Method Summary
Modifier and Type Method Description final Unitappend(BiosignalSample sample)Append a sample and evict anything outside the window. final List<Pair<Long, Double>>asPairs()Returns (timestampMs, bpm) pairs matching the format computeMetrics()expects.final List<BiosignalSample>getAll()Returns all samples currently in the buffer (for biosignal_frame).final Integercount()final BooleanisEmpty()-
-
Constructor Detail
-
SampleRingBuffer
SampleRingBuffer(Integer windowSec)
-
-
Method Detail
-
append
@Synchronized() final Unit append(BiosignalSample sample)
Append a sample and evict anything outside the window.
-
asPairs
@Synchronized() final List<Pair<Long, Double>> asPairs()
Returns (timestampMs, bpm) pairs matching the format
computeMetrics()expects.
-
getAll
@Synchronized() final List<BiosignalSample> getAll()
Returns all samples currently in the buffer (for
biosignal_frame).
-
count
@Synchronized() final Integer count()
-
isEmpty
@Synchronized() final Boolean isEmpty()
-
-
-
-