Class HiccupMonitor
java.lang.Object
com.quantfinlib.util.HiccupMonitor
- All Implemented Interfaces:
AutoCloseable
jHiccup-style platform stall monitor: a daemon thread repeatedly parks for
a fixed resolution and records how much longer than requested each
park took. Any excess is a "hiccup" — GC pause, JVM safepoint, JIT
deoptimization stall, or OS scheduler preemption — exactly the pauses that
corrupt latency percentiles without showing up in application code.
Run one alongside a latency benchmark or a live session: if the
benchmark's p99.9 spikes while the hiccup monitor shows a matching stall,
the platform (not your code) ate the tail. Zero-dependency and
allocation-free while sampling (LatencyRecorder histogram).
See docs/ULTRA_LOW_LATENCY.md for the JVM/kernel tuning that
shrinks what this monitor observes.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
HiccupMonitor
public HiccupMonitor()Default 1 ms sampling resolution. -
HiccupMonitor
public HiccupMonitor(long resolutionNanos)
-
-
Method Details
-
start
-
stop
public void stop() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
recorder
The hiccup histogram: excess-over-requested park time, in nanos. -
samples
public long samples() -
maxHiccupNanos
public long maxHiccupNanos()Worst platform stall observed, in nanoseconds. -
summary
-