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

    Constructors
    Constructor
    Description
    MicrometerTimerTracker(io.micrometer.core.instrument.Timer timer)
    Creates an instance of a MicrometerTimerTracker record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    io.micrometer.core.instrument.Timer
    Returns the value of the timer record component.
    final String
    Returns a string representation of this record class.
    void
    update(long value, TimeUnit timeUnit)
    Adds a record.
    void
    update(Duration duration)
    Adds a record.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MicrometerTimerTracker

      public MicrometerTimerTracker(io.micrometer.core.instrument.Timer timer)
      Creates an instance of a MicrometerTimerTracker record class.
      Parameters:
      timer - the value for the timer record component
  • Method Details

    • update

      public void update(Duration duration)
      Description copied from interface: TimerTracker
      Adds a record.
      Specified by:
      update in interface TimerTracker
      Parameters:
      duration - The duration value.
    • update

      public void update(long value, TimeUnit timeUnit)
      Description copied from interface: TimerTracker
      Adds a record.
      Specified by:
      update in interface TimerTracker
      Parameters:
      value - The value.
      timeUnit - The TimeUnit of the value.
    • count

      public long count()
      Specified by:
      count in interface TimerTracker
      Returns:
      The amount of records.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • timer

      public io.micrometer.core.instrument.Timer timer()
      Returns the value of the timer record component.
      Returns:
      the value of the timer record component