@JsonIgnore public Double getValue() { return adjustSingleResult(results.get(0)); } }
public Stream<Double> getDataPoints() { return timeSeries.stream().map(o -> o.getValue()); }
/** * identifies the stepDuration based on the timeseries. With 'TIMESERIES MAX' New Relic returns the maximum possible * resolution we need to determine the step size. * @param timeSeries to identify stepsize for * @return step size */ private Duration calculateStepDuration(NewRelicTimeSeries timeSeries) { Long firstTimestamp = null; for (NewRelicTimeSeries.NewRelicSeriesEntry entry : timeSeries.getTimeSeries()) { if (firstTimestamp == null) { // get first firstTimestamp = entry.getBeginTimeSeconds(); } else { // get next which differs from first if (!firstTimestamp.equals(entry.getBeginTimeSeconds())) { return Duration.ofSeconds(entry.getBeginTimeSeconds() - firstTimestamp); } } } return Duration.ZERO; } }
public Stream<Double> getDataPoints() { return timeSeries.stream().map(o -> o.getValue()); }
@JsonIgnore public Double getValue() { return adjustSingleResult(results.get(0)); } }
/** * identifies the stepDuration based on the timeseries. With 'TIMESERIES MAX' New Relic returns the maximum possible * resolution we need to determine the step size. * @param timeSeries to identify stepsize for * @return step size */ private Duration calculateStepDuration(NewRelicTimeSeries timeSeries) { Long firstTimestamp = null; for (NewRelicTimeSeries.NewRelicSeriesEntry entry : timeSeries.getTimeSeries()) { if (firstTimestamp == null) { // get first firstTimestamp = entry.getBeginTimeSeconds(); } else { // get next which differs from first if (!firstTimestamp.equals(entry.getBeginTimeSeconds())) { return Duration.ofSeconds(entry.getBeginTimeSeconds() - firstTimestamp); } } } return Duration.ZERO; } }