Search in sources :

Example 1 with DescriptiveStatistics

use of org.apache.commons.math3.stat.descriptive.DescriptiveStatistics in project pinot by linkedin.

the class ForwardIndexReaderBenchmark method multiValuedReadBenchMarkV2.

public static void multiValuedReadBenchMarkV2(File file, int numDocs, int totalNumValues, int maxEntriesPerDoc, int columnSizeInBits) throws Exception {
    boolean signed = false;
    boolean isMmap = false;
    boolean readOneEachTime = true;
    PinotDataBuffer heapBuffer = PinotDataBuffer.fromFile(file, ReadMode.heap, FileChannel.MapMode.READ_ONLY, "benchmarking");
    com.linkedin.pinot.core.io.reader.impl.v2.FixedBitMultiValueReader reader = new com.linkedin.pinot.core.io.reader.impl.v2.FixedBitMultiValueReader(heapBuffer, numDocs, totalNumValues, columnSizeInBits, signed);
    int[] intArray = new int[maxEntriesPerDoc];
    long start, end;
    // read one entry at a time
    if (readOneEachTime) {
        DescriptiveStatistics stats = new DescriptiveStatistics();
        for (int run = 0; run < MAX_RUNS; run++) {
            start = System.currentTimeMillis();
            for (int i = 0; i < numDocs; i++) {
                int length = reader.getIntArray(i, intArray);
            }
            end = System.currentTimeMillis();
            stats.addValue((end - start));
        }
        System.out.println("v2 multi value sequential read one stats for " + file.getName());
        System.out.println(stats.toString().replaceAll("\n", ", ") + " raw:" + Arrays.toString(stats.getValues()));
    }
    reader.close();
    heapBuffer.close();
}
Also used : DescriptiveStatistics(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics) PinotDataBuffer(com.linkedin.pinot.core.segment.memory.PinotDataBuffer)

Example 2 with DescriptiveStatistics

use of org.apache.commons.math3.stat.descriptive.DescriptiveStatistics in project pinot by linkedin.

the class ForwardIndexReaderBenchmark method singleValuedReadBenchMarkV1.

public static void singleValuedReadBenchMarkV1(File file, int numDocs, int columnSizeInBits) throws Exception {
    boolean signed = false;
    boolean isMmap = false;
    PinotDataBuffer heapBuffer = PinotDataBuffer.fromFile(file, ReadMode.heap, FileChannel.MapMode.READ_ONLY, "benchmark");
    BaseSingleColumnSingleValueReader reader = new com.linkedin.pinot.core.io.reader.impl.v1.FixedBitSingleValueReader(heapBuffer, numDocs, columnSizeInBits, signed);
    // sequential read
    long start, end;
    DescriptiveStatistics stats = new DescriptiveStatistics();
    for (int run = 0; run < MAX_RUNS; run++) {
        start = System.currentTimeMillis();
        for (int i = 0; i < numDocs; i++) {
            int value = reader.getInt(i);
        }
        end = System.currentTimeMillis();
        stats.addValue(end - start);
    }
    System.out.println(" v1 sequential read stats for " + file.getName());
    System.out.println(stats.toString().replaceAll("\n", ", ") + " raw:" + Arrays.toString(stats.getValues()));
    reader.close();
    heapBuffer.close();
}
Also used : DescriptiveStatistics(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics) PinotDataBuffer(com.linkedin.pinot.core.segment.memory.PinotDataBuffer) BaseSingleColumnSingleValueReader(com.linkedin.pinot.core.io.reader.BaseSingleColumnSingleValueReader)

Example 3 with DescriptiveStatistics

use of org.apache.commons.math3.stat.descriptive.DescriptiveStatistics in project pinot by linkedin.

the class ContributionViewTableBuilder method addEntry.

public void addEntry(String dimensionValue, TimeBucket timeBucket, Double baselineValue, Double currentValue, Double cumulativeBaselineValue, Double cumulativeCurrentValue) {
    if (finished) {
        throw new RuntimeException("Cannot add more entries since the view is already created");
    }
    DescriptiveStatistics baselineStats;
    DescriptiveStatistics cumulativeCurrentStats;
    DescriptiveStatistics currentStats;
    DescriptiveStatistics cumulativeBaselineStats;
    timeBuckets.add(timeBucket);
    dimensionValueSet.add(dimensionValue);
    baselineStats = getStats(baselineStatsMap, timeBucket);
    currentStats = getStats(currentStatsMap, timeBucket);
    cumulativeBaselineStats = getStats(cumulativeBaselineStatsMap, timeBucket);
    cumulativeCurrentStats = getStats(cumulativeCurrentStatsMap, timeBucket);
    baselineStats.addValue(baselineValue);
    currentStats.addValue(currentValue);
    cumulativeBaselineStats.addValue(cumulativeBaselineValue);
    cumulativeCurrentStats.addValue(cumulativeCurrentValue);
    ContributionCell contributionCell = new ContributionCell(dimensionValue, timeBucket, baselineValue, currentValue, cumulativeBaselineValue, cumulativeCurrentValue);
    cells.add(contributionCell);
    Map<String, ContributionCell> map = timeBucketToDimensionValuesMap.get(timeBucket);
    if (map == null) {
        map = new HashMap<>();
        timeBucketToDimensionValuesMap.put(timeBucket, map);
    }
    map.put(dimensionValue, contributionCell);
}
Also used : DescriptiveStatistics(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics)

Example 4 with DescriptiveStatistics

use of org.apache.commons.math3.stat.descriptive.DescriptiveStatistics in project pinot by linkedin.

the class ContributionViewTableBuilder method getStats.

private DescriptiveStatistics getStats(Map<TimeBucket, DescriptiveStatistics> statsMap, TimeBucket timeBucket) {
    DescriptiveStatistics stats = statsMap.get(timeBucket);
    if (stats == null) {
        stats = new DescriptiveStatistics();
        statsMap.put(timeBucket, stats);
    }
    return stats;
}
Also used : DescriptiveStatistics(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics)

Example 5 with DescriptiveStatistics

use of org.apache.commons.math3.stat.descriptive.DescriptiveStatistics in project GDSC-SMLM by aherbert.

the class PSFEstimator method begin.

public void begin() {
    sampleNew[ANGLE] = new DescriptiveStatistics();
    sampleNew[X] = new DescriptiveStatistics();
    sampleNew[Y] = new DescriptiveStatistics();
}
Also used : DescriptiveStatistics(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics)

Aggregations

DescriptiveStatistics (org.apache.commons.math3.stat.descriptive.DescriptiveStatistics)75 ArrayList (java.util.ArrayList)12 TException (org.apache.thrift.TException)6 Plot (ij.gui.Plot)5 List (java.util.List)5 Test (org.junit.jupiter.api.Test)5 JMeterTransactions (uk.co.automatictester.lightning.data.JMeterTransactions)5 PinotDataBuffer (com.linkedin.pinot.core.segment.memory.PinotDataBuffer)4 Rectangle (java.awt.Rectangle)4 MersenneTwister (org.apache.commons.math3.random.MersenneTwister)4 SummaryStatistics (org.apache.commons.math3.stat.descriptive.SummaryStatistics)4 Percentile (org.apache.commons.math3.stat.descriptive.rank.Percentile)4 PeakResult (gdsc.smlm.results.PeakResult)3 ImagePlus (ij.ImagePlus)3 GenericDialog (ij.gui.GenericDialog)3 ImageProcessor (ij.process.ImageProcessor)3 File (java.io.File)3 WeightedObservedPoint (org.apache.commons.math3.fitting.WeightedObservedPoint)3 StoredDataStatistics (gdsc.core.utils.StoredDataStatistics)2 ImageStack (ij.ImageStack)2