use of eu.fthevenet.binjr.data.timeseries.DoubleTimeSeriesProcessor in project selenium_java by sergueik.
the class CsvFileAdapter method fetchDecodedData.
@Override
public Map<TimeSeriesInfo<Double>, TimeSeriesProcessor<Double>> fetchDecodedData(String path, Instant begin, Instant end, List<TimeSeriesInfo<Double>> seriesInfo, boolean bypassCache) throws DataAdapterException {
if (this.isClosed()) {
throw new IllegalStateException("An attempt was made to fetch data from a closed adapter");
}
Map<TimeSeriesInfo<Double>, TimeSeriesProcessor<Double>> series = new HashMap<>();
Map<String, TimeSeriesInfo<Double>> rDict = new HashMap<>();
for (TimeSeriesInfo<Double> info : seriesInfo) {
rDict.put(info.getBinding().getLabel(), info);
series.put(info, new DoubleTimeSeriesProcessor());
}
for (DataSample<Double> sample : getDataStore().subMap(begin.getEpochSecond(), end.getEpochSecond()).values()) {
for (String n : sample.getCells().keySet()) {
TimeSeriesInfo<Double> i = rDict.get(n);
if (i != null) {
series.get(i).addSample(new XYChart.Data<>(sample.getTimeStamp(), sample.getCells().get(n)));
}
}
}
return series;
}
Aggregations