public final class Benchmark extends Object
public class MyBenchmark { public static void main(final String[] args) { // Build up own config final AbstractConfig config = new MyConfig(); // Initialise benchmark with config final Benchmark benchmark = new Benchmark(config); // Adding Classes to benchmark benchmark.add(Class1.class); benchmark.add(Class2.class); benchmark.add(Object3); // of Class3, every class is allowed to be inserted only once // Running benchmark final BenchmarkResult result = benchmark.run(); // Printing out Result in a Tabular, every AbstractOutput implementing class is allowed. new TabularSummaryOutput().visitBenchmark(result); } }
AbstractConfig
,
BenchmarkResult
Constructor and Description |
---|
Benchmark()
Convience constructor using the
AbstractConfig.StandardConfig |
Benchmark(AbstractConfig paramConf)
Constructor with a fixed set of used meters.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Class<?> clazz)
Adding a class to bench to this benchmark.
|
void |
add(Object obj)
Adding a already instantiated objects to benchmark.
|
List<BenchmarkElement> |
getBenchmarkElements()
Getting all benchmarkable objects out of the registered classes with the
annotated number of runs.
|
List<BenchmarkMethod> |
getBenchmarkMethods()
Getting all Benchmarkable methods out of the registered class.
|
Map<BenchmarkMethod,Integer> |
getNumberOfMethodsAndRuns()
Getting the number of all methods and all runs
|
BenchmarkResult |
run()
Running this benchmark
|
public Benchmark(AbstractConfig paramConf)
paramConf
- Configuration for Benchmarkpublic Benchmark()
AbstractConfig.StandardConfig
public void add(Class<?> clazz)
clazz
- to be added.public void add(Object obj)
obj
- to be addedpublic Map<BenchmarkMethod,Integer> getNumberOfMethodsAndRuns()
public BenchmarkResult run()
BenchmarkResult
the result in an BenchmarkResult
container.public List<BenchmarkMethod> getBenchmarkMethods()
BenchmarkMethod
public List<BenchmarkElement> getBenchmarkElements()
BenchmarkMethod
Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.