Record Class RateSample

java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.congestion.RateSample
Record Components:
deliveryRate - bytes per second, or -1 if the interval was shorter than the minimum RTT (or zero), which makes the sample unreliable
delivered - the bytes delivered over the interval
interval - the interval, in nanoseconds
rtt - the round-trip time of the newest packet acknowledged, in nanoseconds, without any ACK delay removed
appLimited - whether that packet was sent while the application, not the congestion window, limited sending: such a sample may understate the path's bandwidth
priorDelivered - the bytes delivered on the connection when that packet was sent

public record RateSample(long deliveryRate, long delivered, long interval, long rtt, boolean appLimited, long priorDelivered) extends Record
A delivery rate sample (draft-cheng-iccrg-delivery-rate-estimation), taken when an ACK acknowledges packets that were in flight. It describes the newest of them: the bytes delivered between its sending and its acknowledgement, over the longer of its send and ACK intervals.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RateSample(long deliveryRate, long delivered, long interval, long rtt, boolean appLimited, long priorDelivered)
    Creates an instance of a RateSample record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the appLimited record component.
    long
    Returns the value of the delivered record component.
    long
    Returns the value of the deliveryRate record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Whether the sample gives a rate.
    long
    Returns the value of the interval record component.
    long
    Returns the value of the priorDelivered record component.
    long
    rtt()
    Returns the value of the rtt record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • RateSample

      public RateSample(long deliveryRate, long delivered, long interval, long rtt, boolean appLimited, long priorDelivered)
      Creates an instance of a RateSample record class.
      Parameters:
      deliveryRate - the value for the deliveryRate record component
      delivered - the value for the delivered record component
      interval - the value for the interval record component
      rtt - the value for the rtt record component
      appLimited - the value for the appLimited record component
      priorDelivered - the value for the priorDelivered record component
  • Method Details

    • hasRate

      public boolean hasRate()
      Whether the sample gives a rate.
      Returns:
      true if deliveryRate() is not -1
    • 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 '=='.
      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.
    • deliveryRate

      public long deliveryRate()
      Returns the value of the deliveryRate record component.
      Returns:
      the value of the deliveryRate record component
    • delivered

      public long delivered()
      Returns the value of the delivered record component.
      Returns:
      the value of the delivered record component
    • interval

      public long interval()
      Returns the value of the interval record component.
      Returns:
      the value of the interval record component
    • rtt

      public long rtt()
      Returns the value of the rtt record component.
      Returns:
      the value of the rtt record component
    • appLimited

      public boolean appLimited()
      Returns the value of the appLimited record component.
      Returns:
      the value of the appLimited record component
    • priorDelivered

      public long priorDelivered()
      Returns the value of the priorDelivered record component.
      Returns:
      the value of the priorDelivered record component