Algostream_infrastructure_event_bus.InstrumentationLatency instrumentation for the event bus.
Reuses Time_utils.LatencyMonitor for sliding-window stats and SLA violation tracking; adds three named hookpoints:
publish_to_enqueue : producer call → ring-buffer push completedenqueue_to_dispatch : event sat in ring buffer → dispatcher popped itdispatch_to_handler : per-subscriber handler runtimeAll recording goes through record; producers compute the duration themselves from Clock.now_monotonic_ns timestamps to keep the hot path free of monad allocations.
val create : ?window_size:int -> ?sla_ns:int64 -> unit -> tcreate ?window_size ?sla_ns () sets up per-phase monitors with the given sliding-window length (default 4096) and SLA violation threshold (default 5_000_000 ns = 5ms).
val phase_to_string : phase -> stringRecord a duration sample for phase. Cheap; no-op when instrumentation is disabled.
val set_enabled : t -> bool -> unitToggle the instrumentation gate at runtime.
val is_enabled : t -> booltype stats = {publish_to_enqueue : phase_stats;enqueue_to_dispatch : phase_stats;dispatch_to_handler : phase_stats;end_to_end : phase_stats;}val pp_stats : stats -> string