Record Class RelayMetrics

java.lang.Object
java.lang.Record
com.iantapply.relay.core.RelayMetrics
Record Components:
messagesPublished - messages accepted by the transport
messagesReceived - valid envelopes received from the transport
messagesRejected - invalid envelopes or payloads rejected before handler completion
dispatchQueueDrops - handler invocations dropped because the dispatch queue was full
handlerFailures - handlers that threw while processing a message
redisReconnects - successful Redis subscriber reconnections
dispatchQueueSize - handlers currently waiting to run
publisherConnected - whether the publication connection is healthy
subscriberConnected - 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 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 a RelayMetrics record class.
      Parameters:
      messagesPublished - the value for the messagesPublished record component
      messagesReceived - the value for the messagesReceived record component
      messagesRejected - the value for the messagesRejected record component
      dispatchQueueDrops - the value for the dispatchQueueDrops record component
      handlerFailures - the value for the handlerFailures record component
      redisReconnects - the value for the redisReconnects record component
      dispatchQueueSize - the value for the dispatchQueueSize record component
      publisherConnected - the value for the publisherConnected record component
      subscriberConnected - the value for the subscriberConnected record component
  • Method Details

    • redisConnected

      public boolean redisConnected()
      Reports whether both Redis connection roles are healthy.
      Returns:
      whether both Redis connection roles are healthy
    • 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.
    • messagesPublished

      public long messagesPublished()
      Returns the value of the messagesPublished record component.
      Returns:
      the value of the messagesPublished record component
    • messagesReceived

      public long messagesReceived()
      Returns the value of the messagesReceived record component.
      Returns:
      the value of the messagesReceived record component
    • messagesRejected

      public long messagesRejected()
      Returns the value of the messagesRejected record component.
      Returns:
      the value of the messagesRejected record component
    • dispatchQueueDrops

      public long dispatchQueueDrops()
      Returns the value of the dispatchQueueDrops record component.
      Returns:
      the value of the dispatchQueueDrops record component
    • handlerFailures

      public long handlerFailures()
      Returns the value of the handlerFailures record component.
      Returns:
      the value of the handlerFailures record component
    • redisReconnects

      public long redisReconnects()
      Returns the value of the redisReconnects record component.
      Returns:
      the value of the redisReconnects record component
    • dispatchQueueSize

      public int dispatchQueueSize()
      Returns the value of the dispatchQueueSize record component.
      Returns:
      the value of the dispatchQueueSize record component
    • publisherConnected

      public boolean publisherConnected()
      Returns the value of the publisherConnected record component.
      Returns:
      the value of the publisherConnected record component
    • subscriberConnected

      public boolean subscriberConnected()
      Returns the value of the subscriberConnected record component.
      Returns:
      the value of the subscriberConnected record component