Record Class MicrometerTimerTracker
java.lang.Object
java.lang.Record
org.infinispan.commons.stat.micrometer.MicrometerTimerTracker
- All Implemented Interfaces:
TimerTracker
public record MicrometerTimerTracker(io.micrometer.core.instrument.Timer timer)
extends Record
implements TimerTracker
A
TimerTracker
implementation that stores the value in Timer
.- Since:
- 15.1
-
Field Summary
Fields inherited from interface org.infinispan.commons.stat.TimerTracker
NO_OP
-
Constructor Summary
ConstructorsConstructorDescriptionMicrometerTimerTracker
(io.micrometer.core.instrument.Timer timer) Creates an instance of aMicrometerTimerTracker
record class. -
Method Summary
Modifier and TypeMethodDescriptionlong
count()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.io.micrometer.core.instrument.Timer
timer()
Returns the value of thetimer
record component.final String
toString()
Returns a string representation of this record class.void
Adds a record.void
Adds a record.
-
Constructor Details
-
MicrometerTimerTracker
public MicrometerTimerTracker(io.micrometer.core.instrument.Timer timer) Creates an instance of aMicrometerTimerTracker
record class.- Parameters:
timer
- the value for thetimer
record component
-
-
Method Details
-
update
Description copied from interface:TimerTracker
Adds a record.- Specified by:
update
in interfaceTimerTracker
- Parameters:
duration
- The duration value.
-
update
Description copied from interface:TimerTracker
Adds a record.- Specified by:
update
in interfaceTimerTracker
- Parameters:
value
- The value.timeUnit
- TheTimeUnit
of the value.
-
count
public long count()- Specified by:
count
in interfaceTimerTracker
- Returns:
- The amount of records.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
timer
public io.micrometer.core.instrument.Timer timer()Returns the value of thetimer
record component.- Returns:
- the value of the
timer
record component
-