TimeWarp.Telemetry (TimeWarp v0.2.0)

Copy Markdown View Source

Telemetry from the start. Every rollback, anti-message and GVT cycle emits an event, because rollback rate is the diagnostic needed while debugging the engine itself — not something to add once the engine works.

Emission is via :telemetry.execute/3 when the :telemetry library is present, and a no-op otherwise, so the engine carries no hard dependency. The thrash circuit breaker does not rely on this hook — it reads authoritative counters straight from LP stats during each GVT poll.

Event names (all prefixed [:time_warp, ...]):

  • [:time_warp, :rollback] — measurements: %{depth: n, antimsgs: n}
  • [:time_warp, :antimsg] — measurements: %{count: 1}
  • [:time_warp, :event] — measurements: %{count: 1} (event processed)
  • [:time_warp, :gvt] — measurements: %{value: gvt, lag: max_lvt - gvt}

Summary

Functions

emit(event, measurements, metadata)

@spec emit([atom()], map(), map()) :: :ok