public static void main(String[] args) throws Exception { Options opt = new OptionsBuilder() .include(".*\\." + HiveFileFormatBenchmark.class.getSimpleName() + ".*") .jvmArgsAppend("-Xmx4g", "-Xms4g", "-XX:+UseG1GC") .build(); Collection<RunResult> results = new Runner(opt).run(); for (RunResult result : results) { Statistics inputSizeStats = result.getSecondaryResults().get("inputSize").getStatistics(); Statistics outputSizeStats = result.getSecondaryResults().get("outputSize").getStatistics(); double compressionRatio = 1.0 * inputSizeStats.getSum() / outputSizeStats.getSum(); String compression = result.getParams().getParam("compression"); String fileFormat = result.getParams().getParam("fileFormat"); String dataSet = result.getParams().getParam("dataSet"); System.out.printf(" %-10s %-30s %-10s %-25s %2.2f %10s ± %11s (%5.2f%%) (N = %d, \u03B1 = 99.9%%)\n", result.getPrimaryResult().getLabel(), dataSet, compression, fileFormat, compressionRatio, toHumanReadableSpeed((long) inputSizeStats.getMean()), toHumanReadableSpeed((long) inputSizeStats.getMeanErrorAt(0.999)), inputSizeStats.getMeanErrorAt(0.999) * 100 / inputSizeStats.getMean(), inputSizeStats.getN()); } System.out.println(); }
private static List<ImmutablePerformanceResult> getPerformanceResults(Collection<RunResult> results) { long date = System.currentTimeMillis(); return results.stream().map(rs -> ImmutablePerformanceResult.builder() .date(date) .benchmark(getBenchmarkName(rs.getParams())) .samples(rs.getPrimaryResult().getStatistics().getN()) .std(rs.getPrimaryResult().getStatistics().getStandardDeviation()) .mean(rs.getPrimaryResult().getStatistics().getMean()) .data(getData(rs)) .units(rs.getParams().getTimeUnit()) .p50(rs.getPrimaryResult().getStatistics().getPercentile(50.0)) .p90(rs.getPrimaryResult().getStatistics().getPercentile(90.0)) .p99(rs.getPrimaryResult().getStatistics().getPercentile(99.0)) .build()).collect(Collectors.toList()); }
sum += 1 / stats.getMean(); name, compressSize, Util.toHumanReadableSpeed((long) stats.getMean()), Util.toHumanReadableSpeed((long) stats.getMeanErrorAt(0.999)), stats.getMeanErrorAt(0.999) * 100 / stats.getMean(), stats.getN());
for (String param : second.keySet()) { if (auxes.get(param) == i) { builder.append(ScoreFormatter.format(second.get(param).getStatistics().getPercentile(0.5))) .append(", "); found = true; builder.append(ScoreFormatter.format(statistics.getPercentile(0.5))); builder.append(", "); builder.append(ScoreFormatter.format(statistics.getMean())); builder.append(", "); double error = (statistics.getMax() - statistics.getMin()) / 2; builder.append(ScoreFormatter.format(error));
private static List<Double> getRawResults(Statistics statistics) { try { Field field = statistics.getClass().getDeclaredField("values"); field.setAccessible(true); Multiset<Double> rawResults = (Multiset<Double>) field.get(statistics); return downSample(rawResults); } catch (NoSuchFieldException | IllegalAccessException e) { String msg = new StringBuilder().append("Could not get values from statistics !") .append("\n\t statistics.class = ").append(statistics.getClass().getName()) .append("\n\t statistics.size = ").append(statistics.getN()) .toString(); throw new RuntimeException(msg, e); } }
private static void runWith(PrintWriter pw, int threads, String... jvmOpts) throws RunnerException { pw.println(); pw.println("Running with " + threads + " threads and " + Arrays.toString(jvmOpts) + ": "); Options opts = new OptionsBuilder() .threads(threads) .verbosity(VerboseMode.SILENT) .jvmArgs(jvmOpts) .build(); Collection<RunResult> results = new Runner(opts).run(); for (RunResult r : results) { String name = simpleName(r.getParams().getBenchmark()); double score = r.getPrimaryResult().getScore(); double scoreError = r.getPrimaryResult().getStatistics().getMeanErrorAt(0.99); pw.printf("%30s: %11.3f ± %10.3f ns%n", name, score, scoreError); } }
public static void main(String... args) throws Exception { Options opts = new OptionsBuilder() .include(MapperBenchmark.class.getSimpleName()) .warmupIterations(5) .measurementIterations(5) .jvmArgs("-server") .forks(1) .resultFormat(ResultFormatType.TEXT) .build(); Collection<RunResult> results = new Runner(opts).run(); for (RunResult result : results) { Result<?> r = result.getPrimaryResult(); System.out.println("API replied benchmark score: " + r.getScore() + " " + r.getScoreUnit() + " over " + r.getStatistics().getN() + " iterations"); } }
public static void main(String[] args) throws Exception { Options opt = new OptionsBuilder() .include(".*\\." + HiveFileFormatBenchmark.class.getSimpleName() + ".*") .build(); Collection<RunResult> results = new Runner(opt).run(); for (RunResult result : results) { Statistics inputSizeStats = result.getSecondaryResults().get("getInputSize").getStatistics(); Statistics outputSizeStats = result.getSecondaryResults().get("getOutputSize").getStatistics(); double compressionRatio = 1.0 * inputSizeStats.getSum() / outputSizeStats.getSum(); String compression = result.getParams().getParam("compression"); String fileFormat = result.getParams().getParam("fileFormat"); System.out.printf(" %-10s %-22s %-25s %2.2f %10s ± %11s (%5.2f%%) (N = %d, \u03B1 = 99.9%%)\n", result.getPrimaryResult().getLabel(), compression, fileFormat, compressionRatio, toHumanReadableSpeed((long) inputSizeStats.getMean()), toHumanReadableSpeed((long) inputSizeStats.getMeanErrorAt(0.999)), inputSizeStats.getMeanErrorAt(0.999) * 100 / inputSizeStats.getMean(), inputSizeStats.getN()); } System.out.println(); }
public static void main(String[] args) throws Exception { Options opt = new OptionsBuilder() .include(".*\\." + HiveFileFormatBenchmark.class.getSimpleName() + ".*") .jvmArgsAppend("-Xmx4g", "-Xms4g", "-XX:+UseG1GC") .build(); Collection<RunResult> results = new Runner(opt).run(); for (RunResult result : results) { Statistics inputSizeStats = result.getSecondaryResults().get("inputSize").getStatistics(); Statistics outputSizeStats = result.getSecondaryResults().get("outputSize").getStatistics(); double compressionRatio = 1.0 * inputSizeStats.getSum() / outputSizeStats.getSum(); String compression = result.getParams().getParam("compression"); String fileFormat = result.getParams().getParam("fileFormat"); String dataSet = result.getParams().getParam("dataSet"); System.out.printf(" %-10s %-30s %-10s %-25s %2.2f %10s ± %11s (%5.2f%%) (N = %d, \u03B1 = 99.9%%)\n", result.getPrimaryResult().getLabel(), dataSet, compression, fileFormat, compressionRatio, toHumanReadableSpeed((long) inputSizeStats.getMean()), toHumanReadableSpeed((long) inputSizeStats.getMeanErrorAt(0.999)), inputSizeStats.getMeanErrorAt(0.999) * 100 / inputSizeStats.getMean(), inputSizeStats.getN()); } System.out.println(); }
public static void main(String[] args) throws Exception { Options opt = new OptionsBuilder() .include(".*\\." + HiveFileFormatBenchmark.class.getSimpleName() + ".*") .jvmArgsAppend("-Xmx4g", "-Xms4g", "-XX:+UseG1GC") .build(); Collection<RunResult> results = new Runner(opt).run(); for (RunResult result : results) { Statistics inputSizeStats = result.getSecondaryResults().get("inputSize").getStatistics(); Statistics outputSizeStats = result.getSecondaryResults().get("outputSize").getStatistics(); double compressionRatio = 1.0 * inputSizeStats.getSum() / outputSizeStats.getSum(); String compression = result.getParams().getParam("compression"); String fileFormat = result.getParams().getParam("fileFormat"); String dataSet = result.getParams().getParam("dataSet"); System.out.printf(" %-10s %-30s %-10s %-25s %2.2f %10s ± %11s (%5.2f%%) (N = %d, \u03B1 = 99.9%%)\n", result.getPrimaryResult().getLabel(), dataSet, compression, fileFormat, compressionRatio, toHumanReadableSpeed((long) inputSizeStats.getMean()), toHumanReadableSpeed((long) inputSizeStats.getMeanErrorAt(0.999)), inputSizeStats.getMeanErrorAt(0.999) * 100 / inputSizeStats.getMean(), inputSizeStats.getN()); } System.out.println(); }
public static void main(String[] args) throws Exception { Options opt = new OptionsBuilder() .include(".*\\." + HiveFileFormatBenchmark.class.getSimpleName() + ".*") .jvmArgsAppend("-Xmx4g", "-Xms4g", "-XX:+UseG1GC") .build(); Collection<RunResult> results = new Runner(opt).run(); for (RunResult result : results) { Statistics inputSizeStats = result.getSecondaryResults().get("inputSize").getStatistics(); Statistics outputSizeStats = result.getSecondaryResults().get("outputSize").getStatistics(); double compressionRatio = 1.0 * inputSizeStats.getSum() / outputSizeStats.getSum(); String compression = result.getParams().getParam("compression"); String fileFormat = result.getParams().getParam("fileFormat"); String dataSet = result.getParams().getParam("dataSet"); System.out.printf(" %-10s %-30s %-10s %-25s %2.2f %10s ± %11s (%5.2f%%) (N = %d, \u03B1 = 99.9%%)\n", result.getPrimaryResult().getLabel(), dataSet, compression, fileFormat, compressionRatio, toHumanReadableSpeed((long) inputSizeStats.getMean()), toHumanReadableSpeed((long) inputSizeStats.getMeanErrorAt(0.999)), inputSizeStats.getMeanErrorAt(0.999) * 100 / inputSizeStats.getMean(), inputSizeStats.getN()); } System.out.println(); }