@Override public void addMeasurement(Measurement measurement) { log.debug("Adding measurement"); final TimeSeries timeSeries = new TimeSeries(measurement.getLabel()); timeSeries.setKey(measurement.getLabel()); for (CapabilityValue value : measurement.getValues()) { timeSeries.addOrUpdate(new Second(value.getGatherTimestamp()), value.getNumericValue()); } data.addSeries(timeSeries); measurements.put(measurement.getId(), measurement); }
@Override public void newCapabilityValues(java.util.List<CapabilityValue> values) { log.debug("Got new capabilities to update visualization"); for (CapabilityValue value : values) { Measurement measurement = measurements.get(value.getMetricsId()); if (data.getSeries(measurement.getLabel()) == null) { data.addSeries(new TimeSeries(measurement.getLabel())); } data.getSeries(measurement.getLabel()) .addOrUpdate(new Second(value.getGatherTimestamp()), value.getNumericValue()); log.debug("Amount of series: {}", data.getSeries().size()); } }