Record Class MimicReplayProtocol.PacingStats

java.lang.Object
java.lang.Record
com.framed.communicator.driver.protocol.mimic.MimicReplayProtocol.PacingStats
Record Components:
frames - number of frames emitted
samples - number of individual samples published (Σ signals per frame; not simply frames · 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 emit
framesBehind - frames whose lag exceeded one frame period, i.e. that missed their slot
meanLagMillis - arithmetic mean lag
p50LagMillis - median lag
p95LagMillis - 95th-percentile lag
maxLagMillis - largest observed lag
wallElapsedMillis - 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

    Constructors
    Constructor
    Description
    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 a PacingStats record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the value of the achievedHz record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Returns the value of the frames record component.
    long
    Returns the value of the framesBehind record component.
    final int
    Returns a hash code value for this object.
    boolean
    Returns true if 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.
    long
    Returns the value of the maxLagMillis record component.
    double
    Returns the value of the meanLagMillis record component.
    long
    Returns the value of the p50LagMillis record component.
    long
    Returns the value of the p95LagMillis record component.
    long
    Returns the value of the samples record component.
    double
    Returns the value of the targetHz record component.
    Returns a string representation of this record class.
    long
    Returns the value of the wallElapsedMillis record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a PacingStats record class.
      Parameters:
      frames - the value for the frames record component
      samples - the value for the samples record component
      targetHz - the value for the targetHz record component
      achievedHz - the value for the achievedHz record component
      framesBehind - the value for the framesBehind record component
      meanLagMillis - the value for the meanLagMillis record component
      p50LagMillis - the value for the p50LagMillis record component
      p95LagMillis - the value for the p95LagMillis record component
      maxLagMillis - the value for the maxLagMillis record component
      wallElapsedMillis - the value for the wallElapsedMillis record component
  • Method Details

    • keptPace

      public boolean keptPace()
      Returns true if 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

      public 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.
    • frames

      public long frames()
      Returns the value of the frames record component.
      Returns:
      the value of the frames record component
    • samples

      public long samples()
      Returns the value of the samples record component.
      Returns:
      the value of the samples record component
    • targetHz

      public double targetHz()
      Returns the value of the targetHz record component.
      Returns:
      the value of the targetHz record component
    • achievedHz

      public double achievedHz()
      Returns the value of the achievedHz record component.
      Returns:
      the value of the achievedHz record component
    • framesBehind

      public long framesBehind()
      Returns the value of the framesBehind record component.
      Returns:
      the value of the framesBehind record component
    • meanLagMillis

      public double meanLagMillis()
      Returns the value of the meanLagMillis record component.
      Returns:
      the value of the meanLagMillis record component
    • p50LagMillis

      public long p50LagMillis()
      Returns the value of the p50LagMillis record component.
      Returns:
      the value of the p50LagMillis record component
    • p95LagMillis

      public long p95LagMillis()
      Returns the value of the p95LagMillis record component.
      Returns:
      the value of the p95LagMillis record component
    • maxLagMillis

      public long maxLagMillis()
      Returns the value of the maxLagMillis record component.
      Returns:
      the value of the maxLagMillis record component
    • wallElapsedMillis

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