Record Class SDKStats

java.lang.Object
java.lang.Record
dev.tripswitch.SDKStats
Record Components:
droppedSamples - number of samples dropped due to full buffer
bufferSize - current sample buffer size
sseConnected - whether SSE connection is active
sseReconnects - number of SSE reconnection attempts
lastSuccessfulFlush - time of last successful flush
lastSseEvent - time of last SSE event received
flushFailures - number of batches dropped after retry exhaustion
cachedBreakers - number of breakers in local state cache

public record SDKStats(long droppedSamples, int bufferSize, boolean sseConnected, long sseReconnects, Instant lastSuccessfulFlush, Instant lastSseEvent, long flushFailures, int cachedBreakers) extends Record
Health metrics snapshot for the SDK.
  • Constructor Details

    • SDKStats

      public SDKStats(long droppedSamples, int bufferSize, boolean sseConnected, long sseReconnects, Instant lastSuccessfulFlush, Instant lastSseEvent, long flushFailures, int cachedBreakers)
      Creates an instance of a SDKStats record class.
      Parameters:
      droppedSamples - the value for the droppedSamples record component
      bufferSize - the value for the bufferSize record component
      sseConnected - the value for the sseConnected record component
      sseReconnects - the value for the sseReconnects record component
      lastSuccessfulFlush - the value for the lastSuccessfulFlush record component
      lastSseEvent - the value for the lastSseEvent record component
      flushFailures - the value for the flushFailures record component
      cachedBreakers - the value for the cachedBreakers record component
  • 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 '=='.
      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.
    • droppedSamples

      public long droppedSamples()
      Returns the value of the droppedSamples record component.
      Returns:
      the value of the droppedSamples record component
    • bufferSize

      public int bufferSize()
      Returns the value of the bufferSize record component.
      Returns:
      the value of the bufferSize record component
    • sseConnected

      public boolean sseConnected()
      Returns the value of the sseConnected record component.
      Returns:
      the value of the sseConnected record component
    • sseReconnects

      public long sseReconnects()
      Returns the value of the sseReconnects record component.
      Returns:
      the value of the sseReconnects record component
    • lastSuccessfulFlush

      public Instant lastSuccessfulFlush()
      Returns the value of the lastSuccessfulFlush record component.
      Returns:
      the value of the lastSuccessfulFlush record component
    • lastSseEvent

      public Instant lastSseEvent()
      Returns the value of the lastSseEvent record component.
      Returns:
      the value of the lastSseEvent record component
    • flushFailures

      public long flushFailures()
      Returns the value of the flushFailures record component.
      Returns:
      the value of the flushFailures record component
    • cachedBreakers

      public int cachedBreakers()
      Returns the value of the cachedBreakers record component.
      Returns:
      the value of the cachedBreakers record component