/** * Adds the given single data point to the time series * * @param timestamp the timestamp of the value * @param value the belonging value * @return the builder */ public Builder point(long timestamp, String value) { straceTimeSeries.timestamps.add(timestamp); straceTimeSeries.values.add(value); return this; }
/** * Adds a single timestamp and value * * @param timestamp the timestamp * @param value the value */ public final void add(long timestamp, String value) { this.timestamps.add(timestamp); this.values.add(value); }
/** * Adds a single timestamp and value * * @param timestamp the timestamp * @param value the value */ public final void add(long timestamp, double value) { this.timestamps.add(timestamp); this.values.add(value); needsSort = true; }
/** * @param delta the whole list is shifted * @return a new instance with shifted values */ public LongList shift(long delta) { LongList scaled = new LongList(longs.length); for (int i = 0; i < longs.length; i++) { scaled.add(longs[i] + delta); } return scaled; }
/** * Adds the given single data point to the time series * * @param timestamp the timestamp of the value * @param value the belonging value * @return the builder */ public Builder point(long timestamp, double value) { metricTimeSeries.timestamps.add(timestamp); metricTimeSeries.values.add(value); return this; }
/** * Adds the given single data point to the time series * * @param timestamp the timestamp of the value * @param value the belonging value * @return the builder */ public Builder point(long timestamp, double value) { metricTimeSeries.timestamps.add(timestamp); metricTimeSeries.values.add(value); return this; }
/** * Adds a single timestamp and value * * @param timestamp the timestamp * @param value the value */ public final void add(long timestamp, double value) { this.timestamps.add(timestamp); this.values.add(value); }
/** * Sorts the time series values. */ public void sort() { if (timestamps.size() > 1) { LongList sortedTimes = new LongList(timestamps.size()); ArrayList<String> sortedValues = new ArrayList<>(values.size()); points().sorted((o1, o2) -> Long.compare(o1.getTimestamp(), o2.getTimestamp())).forEachOrdered(p -> { sortedTimes.add(p.getTimestamp()); sortedValues.add(p.getValue()); }); timestamps = sortedTimes; values = sortedValues; } }
/** * Sorts the time series values. */ public void sort() { if (timestamps.size() > 1) { LongList sortedTimes = new LongList(timestamps.size()); DoubleList sortedValues = new DoubleList(values.size()); points().sorted((o1, o2) -> Long.compare(o1.getTimestamp(), o2.getTimestamp())).forEachOrdered(p -> { sortedTimes.add(p.getTimestamp()); sortedValues.add(p.getValue()); }); timestamps = sortedTimes; values = sortedValues; } }
/** * Sorts the time series values. */ public void sort() { if (needsSort && timestamps.size() > 1) { LongList sortedTimes = new LongList(timestamps.size()); DoubleList sortedValues = new DoubleList(values.size()); points().sorted((o1, o2) -> Long.compare(o1.getTimestamp(), o2.getTimestamp())).forEachOrdered(p -> { sortedTimes.add(p.getTimestamp()); sortedValues.add(p.getValue()); }); timestamps = sortedTimes; values = sortedValues; needsSort = false; } }
timeList.add(timeSeries.getTime(i)); valueList.add(value); distinct.add(value);