com.google.caliper.runner
Class CaliperMain
java.lang.Object
com.google.caliper.runner.CaliperMain
public final class CaliperMain
- extends Object
Primary entry point for the caliper benchmark runner application; run with --help
for
details. This class's only purpose is to take care of anything that's specific to command-line
invocation and then hand off to CaliperRun
. That is, a hypothetical GUI benchmark runner
might still use CaliperRun
but would skip using this class.
CaliperMain
public CaliperMain()
main
public static void main(Class<? extends Benchmark> benchmarkClass,
String[] args)
- Your benchmark classes can implement main() like this:
public static void main(String[] args) {
CaliperMain.main(MyBenchmark.class, args);
}
Note that this method does invoke System.exit(int)
when it finishes. Consider exitlessMain(java.lang.String[], java.io.PrintWriter)
if you don't want that.
Measurement is handled in a subprocess, so it will not use benchmarkClass
itself;
the class is provided here only as a shortcut for specifying the full class name. The
class that gets loaded later could be completely different.
exitlessMain
public static void exitlessMain(String[] args,
PrintWriter writer)
throws InvalidCommandException,
InvalidBenchmarkException
- Throws:
InvalidCommandException
InvalidBenchmarkException
Copyright © 2009-2011 Google, Inc.. All Rights Reserved.