Record Class RelayMetrics
java.lang.Object
java.lang.Record
com.iantapply.relay.core.RelayMetrics
- Record Components:
messagesPublished- messages accepted by the transportmessagesReceived- valid envelopes received from the transportmessagesRejected- invalid envelopes or payloads rejected before handler completiondispatchQueueDrops- handler invocations dropped because the dispatch queue was fullhandlerFailures- handlers that threw while processing a messageredisReconnects- successful Redis subscriber reconnectionsdispatchQueueSize- handlers currently waiting to runpublisherConnected- whether the publication connection is healthysubscriberConnected- whether the subscription connection is healthy
public record RelayMetrics(long messagesPublished, long messagesReceived, long messagesRejected, long dispatchQueueDrops, long handlerFailures, long redisReconnects, int dispatchQueueSize, boolean publisherConnected, boolean subscriberConnected)
extends Record
Cumulative messaging counters accompanied by current queue and Redis state.
-
Constructor Summary
ConstructorsConstructorDescriptionRelayMetrics(long messagesPublished, long messagesReceived, long messagesRejected, long dispatchQueueDrops, long handlerFailures, long redisReconnects, int dispatchQueueSize, boolean publisherConnected, boolean subscriberConnected) Creates an instance of aRelayMetricsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thedispatchQueueDropsrecord component.intReturns the value of thedispatchQueueSizerecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of thehandlerFailuresrecord component.final inthashCode()Returns a hash code value for this object.longReturns the value of themessagesPublishedrecord component.longReturns the value of themessagesReceivedrecord component.longReturns the value of themessagesRejectedrecord component.booleanReturns the value of thepublisherConnectedrecord component.booleanReports whether both Redis connection roles are healthy.longReturns the value of theredisReconnectsrecord component.booleanReturns the value of thesubscriberConnectedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RelayMetrics
public RelayMetrics(long messagesPublished, long messagesReceived, long messagesRejected, long dispatchQueueDrops, long handlerFailures, long redisReconnects, int dispatchQueueSize, boolean publisherConnected, boolean subscriberConnected) Creates an instance of aRelayMetricsrecord class.- Parameters:
messagesPublished- the value for themessagesPublishedrecord componentmessagesReceived- the value for themessagesReceivedrecord componentmessagesRejected- the value for themessagesRejectedrecord componentdispatchQueueDrops- the value for thedispatchQueueDropsrecord componenthandlerFailures- the value for thehandlerFailuresrecord componentredisReconnects- the value for theredisReconnectsrecord componentdispatchQueueSize- the value for thedispatchQueueSizerecord componentpublisherConnected- the value for thepublisherConnectedrecord componentsubscriberConnected- the value for thesubscriberConnectedrecord component
-
-
Method Details
-
redisConnected
public boolean redisConnected()Reports whether both Redis connection roles are healthy.- Returns:
- whether both Redis connection roles are healthy
-
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. -
messagesPublished
public long messagesPublished()Returns the value of themessagesPublishedrecord component.- Returns:
- the value of the
messagesPublishedrecord component
-
messagesReceived
public long messagesReceived()Returns the value of themessagesReceivedrecord component.- Returns:
- the value of the
messagesReceivedrecord component
-
messagesRejected
public long messagesRejected()Returns the value of themessagesRejectedrecord component.- Returns:
- the value of the
messagesRejectedrecord component
-
dispatchQueueDrops
public long dispatchQueueDrops()Returns the value of thedispatchQueueDropsrecord component.- Returns:
- the value of the
dispatchQueueDropsrecord component
-
handlerFailures
public long handlerFailures()Returns the value of thehandlerFailuresrecord component.- Returns:
- the value of the
handlerFailuresrecord component
-
redisReconnects
public long redisReconnects()Returns the value of theredisReconnectsrecord component.- Returns:
- the value of the
redisReconnectsrecord component
-
dispatchQueueSize
public int dispatchQueueSize()Returns the value of thedispatchQueueSizerecord component.- Returns:
- the value of the
dispatchQueueSizerecord component
-
publisherConnected
public boolean publisherConnected()Returns the value of thepublisherConnectedrecord component.- Returns:
- the value of the
publisherConnectedrecord component
-
subscriberConnected
public boolean subscriberConnected()Returns the value of thesubscriberConnectedrecord component.- Returns:
- the value of the
subscriberConnectedrecord component
-