Package org.apache.calcite.util
Class Benchmark
- java.lang.Object
-
- org.apache.calcite.util.Benchmark
-
public class Benchmark extends java.lang.Object
Helps to run benchmarks by running the same task repeatedly and averaging the running times.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Benchmark.Statistician
Collects statistics for a test that is run multiple times.
-
Field Summary
Fields Modifier and Type Field Description private Function1<Benchmark.Statistician,java.lang.Void>
function
static org.slf4j.Logger
LOGGER
Certain tests are enabled only if logging is enabled at debug level or higher.private int
repeat
private Benchmark.Statistician
statistician
-
Constructor Summary
Constructors Constructor Description Benchmark(java.lang.String description, Function1<Benchmark.Statistician,java.lang.Void> function, int repeat)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
enabled()
Returns whether performance tests are enabled.(package private) static long
printDuration(java.lang.String desc, long t0)
void
run()
-
-
-
Field Detail
-
LOGGER
public static final org.slf4j.Logger LOGGER
Certain tests are enabled only if logging is enabled at debug level or higher.
-
function
private final Function1<Benchmark.Statistician,java.lang.Void> function
-
repeat
private final int repeat
-
statistician
private final Benchmark.Statistician statistician
-
-
Constructor Detail
-
Benchmark
public Benchmark(java.lang.String description, Function1<Benchmark.Statistician,java.lang.Void> function, int repeat)
-
-