Search in sources :

Example 1 with FixedBucketsHistogram

use of org.apache.druid.query.aggregation.histogram.FixedBucketsHistogram in project druid by druid-io.

the class FixedHistogramBenchmark method mergeFixedSameBuckets.

@Benchmark
public void mergeFixedSameBuckets(Blackhole bh) {
    FixedBucketsHistogram copy = fixedHistogram.getCopy();
    copy.combineHistogram(fixedHistogram3);
    bh.consume(copy);
}
Also used : FixedBucketsHistogram(org.apache.druid.query.aggregation.histogram.FixedBucketsHistogram) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 2 with FixedBucketsHistogram

use of org.apache.druid.query.aggregation.histogram.FixedBucketsHistogram in project druid by druid-io.

the class FixedHistogramBenchmark method deserializeFixedSparseUpper.

@Benchmark
public void deserializeFixedSparseUpper(Blackhole bh) {
    FixedBucketsHistogram fixedBucketsHistogram = FixedBucketsHistogram.fromBytes(fixedSparseUpperSerialized);
    bh.consume(fixedBucketsHistogram);
}
Also used : FixedBucketsHistogram(org.apache.druid.query.aggregation.histogram.FixedBucketsHistogram) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 3 with FixedBucketsHistogram

use of org.apache.druid.query.aggregation.histogram.FixedBucketsHistogram in project druid by druid-io.

the class FixedHistogramBenchmark method deserializeFixedFull.

@Benchmark
public void deserializeFixedFull(Blackhole bh) {
    FixedBucketsHistogram fixedBucketsHistogram = FixedBucketsHistogram.fromBytes(fixedFullSerializedAlready);
    bh.consume(fixedBucketsHistogram);
}
Also used : FixedBucketsHistogram(org.apache.druid.query.aggregation.histogram.FixedBucketsHistogram) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 4 with FixedBucketsHistogram

use of org.apache.druid.query.aggregation.histogram.FixedBucketsHistogram in project druid by druid-io.

the class FixedHistogramAddBenchmark method addFixedHistoNormal.

@Benchmark
public void addFixedHistoNormal(Blackhole bh) {
    fixedHistogramForAdds = new FixedBucketsHistogram(LOWER_LIMIT, UPPER_LIMIT, numBuckets, FixedBucketsHistogram.OutlierHandlingMode.OVERFLOW);
    for (int i = 0; i < numEvents; i++) {
        fixedHistogramForAdds.add(normalDistributionValues[i]);
    }
    bh.consume(fixedHistogramForAdds);
}
Also used : FixedBucketsHistogram(org.apache.druid.query.aggregation.histogram.FixedBucketsHistogram) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 5 with FixedBucketsHistogram

use of org.apache.druid.query.aggregation.histogram.FixedBucketsHistogram in project druid by druid-io.

the class FixedHistogramAddBenchmark method setup.

@Setup
public void setup() {
    randomValues = new int[numEvents];
    Random r = ThreadLocalRandom.current();
    for (int i = 0; i < numEvents; i++) {
        randomValues[i] = r.nextInt(UPPER_LIMIT);
    }
    fixedHistogramForAdds = new FixedBucketsHistogram(LOWER_LIMIT, UPPER_LIMIT, numBuckets, FixedBucketsHistogram.OutlierHandlingMode.OVERFLOW);
    NormalDistribution normalDistribution = new NormalDistribution(50000, 10000);
    normalDistributionValues = new float[numEvents];
    for (int i = 0; i < numEvents; i++) {
        normalDistributionValues[i] = (float) normalDistribution.sample();
    }
}
Also used : Random(java.util.Random) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) NormalDistribution(org.apache.commons.math3.distribution.NormalDistribution) FixedBucketsHistogram(org.apache.druid.query.aggregation.histogram.FixedBucketsHistogram) Setup(org.openjdk.jmh.annotations.Setup)

Aggregations

FixedBucketsHistogram (org.apache.druid.query.aggregation.histogram.FixedBucketsHistogram)9 Benchmark (org.openjdk.jmh.annotations.Benchmark)7 Random (java.util.Random)2 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)2 Setup (org.openjdk.jmh.annotations.Setup)2 NormalDistribution (org.apache.commons.math3.distribution.NormalDistribution)1