de.zib.scalaris
Class Benchmark
java.lang.Object
de.zib.scalaris.Benchmark
- Direct Known Subclasses:
- FastStringBenchmark
public class Benchmark
- extends Object
Provides methods to run benchmarks and print the results.
Also provides some default benchmarks.
- Since:
- 2.0
- Version:
- 3.6
- Author:
- Nico Kruber, kruber@zib.de
|
Method Summary |
static
|
getRandom(int size,
Class<T> c)
Creates an object T from size random bytes. |
static void |
minibench(int operations,
int threadsPerNode,
Set<Integer> benchmarks)
Default minimal benchmark. |
Benchmark
public Benchmark()
minibench
public static void minibench(int operations,
int threadsPerNode,
Set<Integer> benchmarks)
- Default minimal benchmark.
Tests some strategies for writing key/value pairs to scalaris:
- writing
OtpErlangBinary objects (random data, size =
BENCH_DATA_SIZE)
- writing
String objects (random data, size =
BENCH_DATA_SIZE)
each with the given number of consecutive operations and parallel
threads per Scalaris node,
- Parameters:
operations - the number of test runs to executethreadsPerNode - number of threads to spawn for each existing Scalaris nodebenchmarks - the benchmarks to run (1-18 or -1 for all benchmarks)
getRandom
public static <T> T getRandom(int size,
Class<T> c)
throws IllegalArgumentException,
SecurityException,
InstantiationException,
IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
- Creates an object T from size random bytes. Uses either a
constructor that expects a byte[] or a
String parameter.
- Type Parameters:
T - the type of the object to create- Parameters:
size - the number of (random) bytes to createc - the class of the object to create (needed due to type erasure)
- Returns:
- the created object
- Throws:
IllegalAccessException - - if this Constructor object enforces Java language access
control and the underlying constructor is inaccessible.
IllegalArgumentException - - if the number of actual and formal parameters differ; if an
unwrapping conversion for primitive arguments fails; or if,
after possible unwrapping, a parameter value cannot be
converted to the corresponding formal parameter type by a
method invocation conversion; if this constructor pertains to
an enum type.
InstantiationException - - if the class that declares the underlying constructor
represents an abstract class.
InvocationTargetException - - if the underlying constructor throws an exception.
ExceptionInInitializerError - - if the initialization provoked by this method fails.
NoSuchMethodException - - if a matching method is not found.
SecurityException - - If a security manager, s, is present and any of the
following conditions is met: invocation of
s.checkMemberAccess(this, Member.PUBLIC) denies access to the
constructor the caller's class loader is not the same as or
an ancestor of the class loader for the current class and
invocation of s.checkPackageAccess() denies access to the
package of this class