Package org.yamcs.http.api
Class Downsampler
- java.lang.Object
-
- org.yamcs.http.api.Downsampler
-
- All Implemented Interfaces:
Consumer<ParameterValueArray>
public class Downsampler extends Object implements Consumer<ParameterValueArray>
One-pass downsampler for time-series data (i.e. numeric archived parameters), where the number of recorded data points are not known upfront.The output is not a bunch of parameter values, but instead a range of values limited to n, which should be fit for inclusion in plots.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Downsampler.Sample
A cumulative sample that keeps track of a rolling average among others.
-
Constructor Summary
Constructors Constructor Description Downsampler(long start, long stop)
Downsampler(long start, long stop, int sampleCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(ParameterValueArray t)
List<Downsampler.Sample>
collect()
long
lastSampleTime()
void
process(long time, double value)
void
process(ParameterValue pval)
-
-
-
Method Detail
-
process
public void process(long time, double value)
-
collect
public List<Downsampler.Sample> collect()
-
process
public void process(ParameterValue pval)
-
lastSampleTime
public long lastSampleTime()
-
accept
public void accept(ParameterValueArray t)
- Specified by:
accept
in interfaceConsumer<ParameterValueArray>
-
-