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();
}
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();
}
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);
}
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;
}
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();
}
Aggregations