@Target(TYPE) @Retention(RUNTIME) public @interface AuxCounters
AuxCounters annotation can be used to mark State objects
as the bearers of auxiliary secondary results. Marking the class with this annotation
will make JMH to treat its public fields and result-returning public methods
as the base for the secondary benchmark metrics.
Properties:
BenchmarkMode,
because not every mode counts time or operations. Mode.AverageTime
and Mode.Throughput are always supported.AuxCounters annotation is only available for Scope.Thread
state objects. It is a compile-time error to use it with other states. This means
the counters are thread-local in nature.boolean/Boolean and char/Character.
It is a compile-time error to use the public field/method with incompatible type.void return type are exempted from type checking.
This means helper Setup and TearDown methods are fine in
AuxCounters.AuxCounters instances would be reset before
starting the iteration, and read back at the end of iteration. This allows
benchmark code to avoid complicated lifecycle handling for these objects.AuxCounters class.
CAVEAT: THIS IS AN EXPERIMENTAL API, it may be changed or removed in future without prior warning. This is a sharp tool, use with care.
| Modifier and Type | Optional Element | Description |
|---|---|---|
AuxCounters.Type |
value |
AuxCounters.Type value
Copyright © 2012-2017 Oracle. All Rights Reserved.