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 unreliabledelivered- the bytes delivered over the intervalinterval- the interval, in nanosecondsrtt- the round-trip time of the newest packet acknowledged, in nanoseconds, without any ACK delay removedappLimited- whether that packet was sent while the application, not the congestion window, limited sending: such a sample may understate the path's bandwidthpriorDelivered- 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
ConstructorsConstructorDescriptionRateSample(long deliveryRate, long delivered, long interval, long rtt, boolean appLimited, long priorDelivered) Creates an instance of aRateSamplerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theappLimitedrecord component.longReturns the value of thedeliveredrecord component.longReturns the value of thedeliveryRaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhasRate()Whether the sample gives a rate.longinterval()Returns the value of theintervalrecord component.longReturns the value of thepriorDeliveredrecord component.longrtt()Returns the value of therttrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RateSample
public RateSample(long deliveryRate, long delivered, long interval, long rtt, boolean appLimited, long priorDelivered) Creates an instance of aRateSamplerecord class.- Parameters:
deliveryRate- the value for thedeliveryRaterecord componentdelivered- the value for thedeliveredrecord componentinterval- the value for theintervalrecord componentrtt- the value for therttrecord componentappLimited- the value for theappLimitedrecord componentpriorDelivered- the value for thepriorDeliveredrecord component
-
-
Method Details
-
hasRate
public boolean hasRate()Whether the sample gives a rate.- Returns:
- true if
deliveryRate()is not -1
-
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. -
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. -
equals
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 '=='. -
deliveryRate
public long deliveryRate()Returns the value of thedeliveryRaterecord component.- Returns:
- the value of the
deliveryRaterecord component
-
delivered
public long delivered()Returns the value of thedeliveredrecord component.- Returns:
- the value of the
deliveredrecord component
-
interval
public long interval()Returns the value of theintervalrecord component.- Returns:
- the value of the
intervalrecord component
-
rtt
public long rtt()Returns the value of therttrecord component.- Returns:
- the value of the
rttrecord component
-
appLimited
public boolean appLimited()Returns the value of theappLimitedrecord component.- Returns:
- the value of the
appLimitedrecord component
-
priorDelivered
public long priorDelivered()Returns the value of thepriorDeliveredrecord component.- Returns:
- the value of the
priorDeliveredrecord component
-