update primitiveCollections to 0.2
This commit is contained in:
@@ -58,10 +58,6 @@ public class CumulativeDistributionCustomAggregator implements CustomAggregator
|
||||
}
|
||||
}
|
||||
|
||||
public long getMaxValue() {
|
||||
return maxValue;
|
||||
}
|
||||
|
||||
public Percentiles getPercentiles() {
|
||||
return percentiles;
|
||||
}
|
||||
@@ -86,18 +82,15 @@ public class CumulativeDistributionCustomAggregator implements CustomAggregator
|
||||
|
||||
@Override
|
||||
public void addValue(final long epochMilli, final long value) {
|
||||
map.compute(value, 0, l -> l + 1);
|
||||
map.compute(value, 0, (__, l) -> l + 1);
|
||||
totalValues++;
|
||||
}
|
||||
|
||||
public Percentiles getPercentiles() {
|
||||
final long start = System.nanoTime();
|
||||
|
||||
final ToPercentiles toPercentiles = new ToPercentiles(totalValues);
|
||||
toPercentiles.collect(map);
|
||||
|
||||
final Percentiles result = toPercentiles.getPercentiles();
|
||||
System.out.println("getPercentiles took: " + (System.nanoTime() - start) / 1_000_000.0 + " ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -107,10 +100,8 @@ public class CumulativeDistributionCustomAggregator implements CustomAggregator
|
||||
final char separator = ',';
|
||||
final char newline = '\n';
|
||||
|
||||
final long start = System.nanoTime();
|
||||
final ToPercentiles toPercentiles = new ToPercentiles(totalValues);
|
||||
toPercentiles.collect(map);
|
||||
System.out.println("getAggregated took: " + (System.nanoTime() - start) / 1_000_000.0 + " ms");
|
||||
|
||||
final File dataFile = File.createTempFile("data", ".dat", tmpDir.toFile());
|
||||
try (final Writer output = new BufferedWriter(
|
||||
|
||||
@@ -30,7 +30,7 @@ public class HistogramAggregator implements CustomAggregator {
|
||||
@Override
|
||||
public void accept(final long key, final long value) {
|
||||
final long bin = binWidth * (key / binWidth);
|
||||
bins.compute(bin, 0, oldValue -> oldValue + value);
|
||||
bins.compute(bin, 0, (__, oldValue) -> oldValue + value);
|
||||
}
|
||||
|
||||
public LongLongHashMap getBins() {
|
||||
@@ -52,7 +52,7 @@ public class HistogramAggregator implements CustomAggregator {
|
||||
|
||||
@Override
|
||||
public void addValue(final long epochMilli, final long value) {
|
||||
map.compute(value, 0, l -> l + 1);
|
||||
map.compute(value, 0, (__, l) -> l + 1);
|
||||
min = min < value ? min : value;
|
||||
max = max > value ? max : value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user