Record Class StatisticsSnapshot

java.lang.Object
java.lang.Record
org.j7m.middleware.metrics.StatisticsSnapshot
Record Components:
totalCount - total event count
successCount - successful event count
failureCount - failed event count
averageLatencyNanos - average latency
retainedEventCount - retained event count
counters - named counters

public record StatisticsSnapshot(long totalCount, long successCount, long failureCount, long averageLatencyNanos, int retainedEventCount, Map<String,Long> counters) extends Record
Immutable statistics snapshot.
  • Constructor Details

    • StatisticsSnapshot

      public StatisticsSnapshot(long totalCount, long successCount, long failureCount, long averageLatencyNanos, int retainedEventCount, Map<String,Long> counters)
      Creates immutable counters.
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • totalCount

      public long totalCount()
      Returns the value of the totalCount record component.
      Returns:
      the value of the totalCount record component
    • successCount

      public long successCount()
      Returns the value of the successCount record component.
      Returns:
      the value of the successCount record component
    • failureCount

      public long failureCount()
      Returns the value of the failureCount record component.
      Returns:
      the value of the failureCount record component
    • averageLatencyNanos

      public long averageLatencyNanos()
      Returns the value of the averageLatencyNanos record component.
      Returns:
      the value of the averageLatencyNanos record component
    • retainedEventCount

      public int retainedEventCount()
      Returns the value of the retainedEventCount record component.
      Returns:
      the value of the retainedEventCount record component
    • counters

      public Map<String,Long> counters()
      Returns the value of the counters record component.
      Returns:
      the value of the counters record component