diff --git a/src/main/java/net/iponweb/disthene/reader/graphite/functions/DistheneFunction.java b/src/main/java/net/iponweb/disthene/reader/graphite/functions/DistheneFunction.java index a24c9f27..74d7cf1f 100644 --- a/src/main/java/net/iponweb/disthene/reader/graphite/functions/DistheneFunction.java +++ b/src/main/java/net/iponweb/disthene/reader/graphite/functions/DistheneFunction.java @@ -90,7 +90,7 @@ public Target shiftBy(long shift) { @Override public Target previous(long period) { try { - DistheneFunction function = FunctionRegistry.getFunction(getContext(), name, to - period , to - 1); + DistheneFunction function = FunctionRegistry.getFunction(getContext(), name, from - period , from - 1); for (Object argument : arguments) { if (argument instanceof Target) { diff --git a/src/main/java/net/iponweb/disthene/reader/utils/TimeSeriesUtils.java b/src/main/java/net/iponweb/disthene/reader/utils/TimeSeriesUtils.java index 2018eebd..5a8d906a 100644 --- a/src/main/java/net/iponweb/disthene/reader/utils/TimeSeriesUtils.java +++ b/src/main/java/net/iponweb/disthene/reader/utils/TimeSeriesUtils.java @@ -2,9 +2,7 @@ import net.iponweb.disthene.reader.beans.TimeSeries; -import java.math.BigInteger; import java.util.ArrayList; -import java.util.Collections; import java.util.List; /** @@ -75,7 +73,7 @@ private static void align(List timeSeries) { // todo: think about different consolidation functions? // todo: assuming timeSeries.from <= from <= to <= timeSeries.to - has to be checked? // todo: from % step == 0 && to % step == 0 - public static void consolidate(TimeSeries timeSeries, int step, long from, long to) { + private static void consolidate(TimeSeries timeSeries, int step, long from, long to) { List consolidated = new ArrayList<>(); List buffer = new ArrayList<>();