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 Summary
ConstructorsConstructorDescriptionMetrics(int listenerCount, long eventsDispatched, long eventsDropped, long errors) Creates an instance of aMetricsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.doubleGet error rate 获取错误率longerrors()Returns the value of theerrorsrecord component.longReturns the value of theeventsDispatchedrecord component.longReturns the value of theeventsDroppedrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of thelistenerCountrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Metrics
public Metrics(int listenerCount, long eventsDispatched, long eventsDropped, long errors) Creates an instance of aMetricsrecord class.- Parameters:
listenerCount- the value for thelistenerCountrecord componenteventsDispatched- the value for theeventsDispatchedrecord componenteventsDropped- the value for theeventsDroppedrecord componenterrors- the value for theerrorsrecord component
-
-
Method Details
-
errorRate
public double errorRate()Get error rate 获取错误率- Returns:
- error rate (0.0 to 1.0) | 错误率 (0.0 到 1.0)
-
toString
-
hashCode
-
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 with thecomparemethod from their corresponding wrapper classes. -
listenerCount
public int listenerCount()Returns the value of thelistenerCountrecord component.- Returns:
- the value of the
listenerCountrecord component
-
eventsDispatched
public long eventsDispatched()Returns the value of theeventsDispatchedrecord component.- Returns:
- the value of the
eventsDispatchedrecord component
-
eventsDropped
public long eventsDropped()Returns the value of theeventsDroppedrecord component.- Returns:
- the value of the
eventsDroppedrecord component
-
errors
-