Record Class StreamingChannel.ChannelMetrics

java.lang.Object
java.lang.Record
com.tnsai.coordination.streaming.StreamingChannel.ChannelMetrics
Enclosing class:
StreamingChannel<T>

public static record StreamingChannel.ChannelMetrics(String channelId, long emitted, long dropped, int bufferUsed, int bufferCapacity, int subscriberCount, boolean completed) extends Record
Channel metrics snapshot.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChannelMetrics(String channelId, long emitted, long dropped, int bufferUsed, int bufferCapacity, int subscriberCount, boolean completed)
    Creates an instance of a ChannelMetrics record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the bufferCapacity record component.
    int
    Returns the value of the bufferUsed record component.
    Returns the value of the channelId record component.
    boolean
    Returns the value of the completed record component.
    long
    Returns the value of the dropped record component.
    double
     
    long
    Returns the value of the emitted record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the subscriberCount record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ChannelMetrics

      public ChannelMetrics(String channelId, long emitted, long dropped, int bufferUsed, int bufferCapacity, int subscriberCount, boolean completed)
      Creates an instance of a ChannelMetrics record class.
      Parameters:
      channelId - the value for the channelId record component
      emitted - the value for the emitted record component
      dropped - the value for the dropped record component
      bufferUsed - the value for the bufferUsed record component
      bufferCapacity - the value for the bufferCapacity record component
      subscriberCount - the value for the subscriberCount record component
      completed - the value for the completed record component
  • Method Details

    • dropRate

      public double dropRate()
    • 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.
    • channelId

      public String channelId()
      Returns the value of the channelId record component.
      Returns:
      the value of the channelId record component
    • emitted

      public long emitted()
      Returns the value of the emitted record component.
      Returns:
      the value of the emitted record component
    • dropped

      public long dropped()
      Returns the value of the dropped record component.
      Returns:
      the value of the dropped record component
    • bufferUsed

      public int bufferUsed()
      Returns the value of the bufferUsed record component.
      Returns:
      the value of the bufferUsed record component
    • bufferCapacity

      public int bufferCapacity()
      Returns the value of the bufferCapacity record component.
      Returns:
      the value of the bufferCapacity record component
    • subscriberCount

      public int subscriberCount()
      Returns the value of the subscriberCount record component.
      Returns:
      the value of the subscriberCount record component
    • completed

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