Enum Level
- All Implemented Interfaces:
Serializable
,Comparable<Level>
,java.lang.constant.Constable
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionInvocation level: to be executed for each benchmark method execution.Iteration level: to be executed before/after each iteration of the benchmark.Trial level: to be executed before/after each run of the benchmark. -
Constructor Summary
Constructors -
Method Summary
-
Enum Constant Details
-
Trial
Trial level: to be executed before/after each run of the benchmark.Trial is the set of benchmark iterations.
-
Iteration
Iteration level: to be executed before/after each iteration of the benchmark.Iteration is the set of benchmark invocations.
-
Invocation
Invocation level: to be executed for each benchmark method execution.WARNING: HERE BE DRAGONS! THIS IS A SHARP TOOL. MAKE SURE YOU UNDERSTAND THE REASONING AND THE IMPLICATIONS OF THE WARNINGS BELOW BEFORE EVEN CONSIDERING USING THIS LEVEL.
This level is only usable for benchmarks taking more than a millisecond per single
Benchmark
method invocation. It is a good idea to validate the impact for your case on ad-hoc basis as well.WARNING #1: Since we have to subtract the setup/teardown costs from the benchmark time, on this level, we have to timestamp *each* benchmark invocation. If the benchmarked method is small, then we saturate the system with timestamp requests, which introduce artificial latency, throughput, and scalability bottlenecks.
WARNING #2: Since we measure individual invocation timings with this level, we probably set ourselves up for (coordinated) omission. That means the hiccups in measurement can be hidden from timing measurement, and can introduce surprising results. For example, when we use timings to understand the benchmark throughput, the omitted timing measurement will result in lower aggregate time, and fictionally *larger* throughput.
WARNING #3: In order to maintain the same sharing behavior as other Levels, we sometimes have to synchronize (arbitrage) the access to
State
objects. Other levels do this outside the measurement, but at this level, we have to synchronize on *critical path*, further offsetting the measurement.WARNING #4: Current implementation allows the helper method execution at this Level to overlap with the benchmark invocation itself in order to simplify arbitrage. That matters in multi-threaded benchmarks, when one worker thread executing
Benchmark
method may observe other worker thread already callingTearDown
for the same object.
-
-
Constructor Details
-
Level
private Level()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-