Record Class CacheEventDispatcher.Metrics

java.lang.Object
java.lang.Record
cloud.opencode.base.cache.event.CacheEventDispatcher.Metrics
Record Components:
listenerCount - the number of registered listeners | 注册的监听器数
eventsDispatched - the total events dispatched | 已分发的事件总数
eventsDropped - the total events dropped | 已丢弃的事件总数
errors - the total number of errors | 错误总数
Enclosing class:
CacheEventDispatcher<K,V>

public static record CacheEventDispatcher.Metrics(int listenerCount, long eventsDispatched, long eventsDropped, long errors) extends Record
Dispatcher metrics 分发器指标
Since:
JDK 25, opencode-base-cache V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • Metrics

      public Metrics(int listenerCount, long eventsDispatched, long eventsDropped, long errors)
      Creates an instance of a Metrics record class.
      Parameters:
      listenerCount - the value for the listenerCount record component
      eventsDispatched - the value for the eventsDispatched record component
      eventsDropped - the value for the eventsDropped record component
      errors - the value for the errors record component
  • Method Details

    • errorRate

      public double errorRate()
      Get error rate 获取错误率
      Returns:
      error rate (0.0 to 1.0) | 错误率 (0.0 到 1.0)
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • listenerCount

      public int listenerCount()
      Returns the value of the listenerCount record component.
      Returns:
      the value of the listenerCount record component
    • eventsDispatched

      public long eventsDispatched()
      Returns the value of the eventsDispatched record component.
      Returns:
      the value of the eventsDispatched record component
    • eventsDropped

      public long eventsDropped()
      Returns the value of the eventsDropped record component.
      Returns:
      the value of the eventsDropped record component
    • errors

      public long errors()
      Returns the value of the errors record component.
      Returns:
      the value of the errors record component