F1
- type of the field.F2
- type of the field.public abstract class Timer2<F1,F2> extends Object implements com.google.gerrit.extensions.registration.RegistrationHandle
Typical usage in a try-with-resources block:
try (Timer2.Context ctx = timer.start(field)) { }
Modifier and Type | Class and Description |
---|---|
static class |
Timer2.Context |
Constructor and Description |
---|
Timer2() |
Modifier and Type | Method and Description |
---|---|
abstract void |
record(F1 field1,
F2 field2,
long value,
TimeUnit unit)
Record a value in the distribution.
|
Timer2.Context |
start(F1 field1,
F2 field2)
Begin a timer for the current block, value will be recorded when closed.
|
public Timer2.Context start(F1 field1, F2 field2)
field1
- bucket to record the timerfield2
- bucket to record the timer