builder.points(new LongList(timestamps, lastPointIndex), new DoubleList(values, lastPointIndex));
builder.points(new LongList(timestamps, lastPointIndex), new DoubleList(values, lastPointIndex));
.points(timestamps, values) .attributes(attributes) .build();
/** * Copies a given metric time series. * * @param ts the time series * @return builder preconfigured with values from the given time series */ public MetricTimeSeries.Builder copy(MetricTimeSeries ts) { MetricTimeSeries.Builder result = new MetricTimeSeries.Builder(ts.getName(), ts.getType()); result.start(ts.getStart()); result.end(ts.getEnd()); result.points(ts.getTimestamps(), ts.getValues()); result.attributes(ts.attributes()); return result; } }
/** * @param scale to be applied to the values of this list * @return a new instance scaled with the given parameter */ public MetricTimeSeries scale(final double scale) { return new MetricTimeSeries.Builder(metric + " scaled by " + scale).points(timestamps, values.scale(scale)).build(); }
/** * @param scale to be applied to the values of this list * @return a new instance scaled with the given parameter */ public MetricTimeSeries scale(final double scale) { return new Builder(metric + " scaled by " + scale).points(timestamps, values.scale(scale)).build(); }
/** * @param delta the whole list is shifted * @return a new instance with shifted values */ public MetricTimeSeries shift(final long delta) { return new MetricTimeSeries.Builder(metric + " shifted by " + delta).points(timestamps.shift(delta), values).build(); }
/** * @param delta the whole list is shifted * @return a new instance with shifted values */ public MetricTimeSeries shift(final long delta) { return new Builder(metric + " shifted by " + delta).points(timestamps.shift(delta), values).build(); }
private MetricTimeSeries copyWithDataRange(MetricTimeSeries ts, int start, int end) { return converterService.copy(ts) .points(sublist(timestamps, start, end), subList(values, start, end)) .start(timestamps.get(start)) .end(timestamps.get(end - 1)) .build(); } }