use of org.openjdk.jmh.results.RunResult in project h2o-3 by h2oai.
the class H2OResultFormat method main.
/**
* Copy of {@link org.openjdk.jmh.Main#main(java.lang.String[])}
*
* @param args command line parameters
*/
public static void main(String[] args) {
// Try to run benchmark and collect results
try {
CommandLineOptions cmdOptions = new CommandLineOptions(args);
Runner runner = new Runner(cmdOptions);
Collection<RunResult> results = null;
try {
results = runner.run();
// Bench code passed so report results
if (H2O_UBENCH_REPORT_FILE != null) {
// Create an output directory
File ubenchReportFile = new File(H2O_UBENCH_REPORT_FILE);
getResultFormater(ubenchReportFile).writeOut(results);
}
} catch (NoBenchmarksException e) {
System.err.println("No matching benchmarks. Miss-spelled regexp?");
if (cmdOptions.verbosity().orElse(Defaults.VERBOSITY) != VerboseMode.EXTRA) {
System.err.println("Use " + VerboseMode.EXTRA + " verbose mode to debug the pattern matching.");
} else {
runner.list();
}
System.exit(1);
} catch (ProfilersFailedException e) {
// This is not exactly an error, set non-zero exit code
System.err.println(e.getMessage());
System.exit(1);
} catch (RunnerException e) {
System.err.print("ERROR: ");
e.printStackTrace(System.err);
System.exit(1);
}
} catch (CommandLineOptionException e) {
System.err.println("Error parsing command line:");
System.err.println(" " + e.getMessage());
System.exit(1);
}
}
use of org.openjdk.jmh.results.RunResult in project presto by prestodb.
the class HiveFileFormatBenchmark method main.
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();
}
use of org.openjdk.jmh.results.RunResult in project h2o-3 by h2oai.
the class H2OResultFormat method writeOut.
@Override
public void writeOut(Collection<RunResult> results) {
SortedSet<String> params = new TreeSet<String>();
for (RunResult res : results) {
params.addAll(res.getParams().getParamsKeys());
}
printHeader(params);
for (RunResult rr : results) {
BenchmarkParams benchParams = rr.getParams();
Result res = rr.getPrimaryResult();
printLine(sha, date, benchParams.getBenchmark(), benchParams, params, res);
for (String label : rr.getSecondaryResults().keySet()) {
Result subRes = rr.getSecondaryResults().get(label);
printLine(sha, date, benchParams.getBenchmark() + ":" + subRes.getLabel(), benchParams, params, subRes);
}
}
}
use of org.openjdk.jmh.results.RunResult in project atlasdb by palantir.
the class AtlasDbPerfCli method runCli.
private static void runCli(AtlasDbPerfCli cli, ChainedOptionsBuilder optBuilder) throws Exception {
optBuilder.warmupIterations(1).mode(Mode.SampleTime);
Collection<RunResult> results = new Runner(optBuilder.build()).run();
if (cli.outputFile != null) {
new PerformanceResults(results).writeToFile(new File(cli.outputFile));
}
}
use of org.openjdk.jmh.results.RunResult in project qpp-conversion-tool by CMSgov.
the class ParameterizedBenchmarkTest method loadPaths.
@BeforeAll
static void loadPaths() throws RunnerException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
String[] paths = FileTestHelper.getAllQrdaFiles(FileSystems.getDefault(), "-latest.xml").map(Path::toString).toArray(String[]::new);
Options opt = new OptionsBuilder().mode(Mode.Throughput).mode(Mode.AverageTime).include(".*" + ParameterizedBenchmark.class.getSimpleName() + ".*").param("fileName", paths).forks(1).build();
List<RunResult> results = new ArrayList<>(new Runner(opt).run());
benchResults = results.stream().map(RunResult::getAggregatedResult).collect(Collectors.toList());
}
Aggregations