Record Class MimicReplayProtocol.PacingStats
java.lang.Object
java.lang.Record
com.framed.communicator.driver.protocol.mimic.MimicReplayProtocol.PacingStats
- Record Components:
frames- number of frames emittedsamples- number of individual samples published (Σ signals per frame; not simplyframes · signals, since a multi-segment record may carry a different signal set per segment)targetHz- frame rate the replay was scheduled at (fs · speed)achievedHz- frames divided by the wall-clock span between first and last emitframesBehind- frames whose lag exceeded one frame period, i.e. that missed their slotmeanLagMillis- arithmetic mean lagp50LagMillis- median lagp95LagMillis- 95th-percentile lagmaxLagMillis- largest observed lagwallElapsedMillis- wall-clock span between the first and last emit
- Enclosing class:
MimicReplayProtocol
public static record MimicReplayProtocol.PacingStats(long frames, long samples, double targetHz, double achievedHz, long framesBehind, double meanLagMillis, long p50LagMillis, long p95LagMillis, long maxLagMillis, long wallElapsedMillis)
extends Record
Immutable summary of how closely replay followed its schedule.
For frame i the scheduled emit time is start + i / (fs · speed) and the
lag is actualEmit − scheduled. Lag is non-negative by construction (the
replay loop only ever sleeps to catch up to the schedule, never runs ahead of it), so a
persistently growing lag means the deployment cannot sustain the target rate.
Percentiles come from a bucketed histogram: exact at 1 ms resolution below one second, ~10 % relative resolution above it. They are therefore lower bounds on the true value.
-
Constructor Summary
ConstructorsConstructorDescriptionPacingStats(long frames, long samples, double targetHz, double achievedHz, long framesBehind, double meanLagMillis, long p50LagMillis, long p95LagMillis, long maxLagMillis, long wallElapsedMillis) Creates an instance of aPacingStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theachievedHzrecord component.final booleanIndicates whether some other object is "equal to" this one.longframes()Returns the value of theframesrecord component.longReturns the value of theframesBehindrecord component.final inthashCode()Returns a hash code value for this object.booleankeptPace()Returnstrueif the producer held its schedule: at least 98 % of the target rate was achieved and no frame missed its slot by more than one frame period.longReturns the value of themaxLagMillisrecord component.doubleReturns the value of themeanLagMillisrecord component.longReturns the value of thep50LagMillisrecord component.longReturns the value of thep95LagMillisrecord component.longsamples()Returns the value of thesamplesrecord component.doubletargetHz()Returns the value of thetargetHzrecord component.toString()Returns a string representation of this record class.longReturns the value of thewallElapsedMillisrecord component.
-
Constructor Details
-
PacingStats
public PacingStats(long frames, long samples, double targetHz, double achievedHz, long framesBehind, double meanLagMillis, long p50LagMillis, long p95LagMillis, long maxLagMillis, long wallElapsedMillis) Creates an instance of aPacingStatsrecord class.- Parameters:
frames- the value for theframesrecord componentsamples- the value for thesamplesrecord componenttargetHz- the value for thetargetHzrecord componentachievedHz- the value for theachievedHzrecord componentframesBehind- the value for theframesBehindrecord componentmeanLagMillis- the value for themeanLagMillisrecord componentp50LagMillis- the value for thep50LagMillisrecord componentp95LagMillis- the value for thep95LagMillisrecord componentmaxLagMillis- the value for themaxLagMillisrecord componentwallElapsedMillis- the value for thewallElapsedMillisrecord component
-
-
Method Details
-
keptPace
public boolean keptPace()Returnstrueif the producer held its schedule: at least 98 % of the target rate was achieved and no frame missed its slot by more than one frame period.- Returns:
- whether the replay kept pace with the configured sample rate
-
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 '=='. -
frames
public long frames()Returns the value of theframesrecord component.- Returns:
- the value of the
framesrecord component
-
samples
public long samples()Returns the value of thesamplesrecord component.- Returns:
- the value of the
samplesrecord component
-
targetHz
public double targetHz()Returns the value of thetargetHzrecord component.- Returns:
- the value of the
targetHzrecord component
-
achievedHz
public double achievedHz()Returns the value of theachievedHzrecord component.- Returns:
- the value of the
achievedHzrecord component
-
framesBehind
public long framesBehind()Returns the value of theframesBehindrecord component.- Returns:
- the value of the
framesBehindrecord component
-
meanLagMillis
public double meanLagMillis()Returns the value of themeanLagMillisrecord component.- Returns:
- the value of the
meanLagMillisrecord component
-
p50LagMillis
public long p50LagMillis()Returns the value of thep50LagMillisrecord component.- Returns:
- the value of the
p50LagMillisrecord component
-
p95LagMillis
public long p95LagMillis()Returns the value of thep95LagMillisrecord component.- Returns:
- the value of the
p95LagMillisrecord component
-
maxLagMillis
public long maxLagMillis()Returns the value of themaxLagMillisrecord component.- Returns:
- the value of the
maxLagMillisrecord component
-
wallElapsedMillis
public long wallElapsedMillis()Returns the value of thewallElapsedMillisrecord component.- Returns:
- the value of the
wallElapsedMillisrecord component
-
