ZenWebsocket.HeartbeatInterval (ZenWebsocket v0.7.1)

Copy Markdown View Source

Records application-level heartbeat pongs and emits interval telemetry.

Summary

Functions

Updates heartbeat tracking and emits [:zen_websocket, :heartbeat, :pong].

Functions

record_pong(state, type, active_heartbeats)

@spec record_pong(map(), term(), MapSet.t()) :: map()

Updates heartbeat tracking and emits [:zen_websocket, :heartbeat, :pong].

Measures time between responses (regularity), not true RTT, which would require tracking when the request was sent. The caller supplies active_heartbeats so generic pongs can replace the set while Deribit pongs accumulate.