Class LatencyRecorder

java.lang.Object
com.quantfinlib.util.LatencyRecorder

public final class LatencyRecorder extends Object
Zero-allocation nanosecond latency histogram (HdrHistogram-style log-linear buckets: 16 sub-buckets per power of two, ~6% worst-case quantile error). record(long) is a couple of array writes — safe to call on the hot path. Single-writer; not thread-safe.
  • Constructor Details

    • LatencyRecorder

      public LatencyRecorder()
  • Method Details

    • record

      public void record(long nanos)
    • percentile

      public long percentile(double p)
      Estimated latency at quantile p in [0, 1], in nanoseconds.
    • count

      public long count()
    • max

      public long max()
    • min

      public long min()
    • mean

      public double mean()
    • reset

      public void reset()
    • summary

      public String summary()
      One-line summary: p50/p90/p99/p99.9/max in appropriate units.