Raxol.Performance.TelemetryInstrumentation (Raxol v2.0.1)

View Source

Telemetry instrumentation for Raxol hot paths.

Provides consistent telemetry events across the codebase for:

  • Performance monitoring
  • Predictive optimization
  • Debugging and profiling

All measurements are in microseconds unless otherwise noted.

Summary

Functions

buffer_read(buffer_id, bytes_read, cell_count)

buffer_scroll(buffer_id, lines)

buffer_write(buffer_id, bytes_written, cell_count)

Record buffer operations.

cache_eviction(cache_name, evicted_count)

cache_hit(cache_name, key)

Record a cache hit or miss.

cache_miss(cache_name, key)

instrument(event_name, metadata \\ %{}, fun)

Instrument a function call with telemetry.

Example

instrument(:terminal_parse, %{sequence_type: :csi}, fn ->
  # expensive operation
end)

layout_calculation(tree_hash, constraints, fun)

parse_ansi(sequence_type, sequence_length, fun)

Record parser operations.

parse_csi(sequence, fun)

render_start(component_type, props_hash)

Record rendering operations.

render_stop(component_type, span, rendered_nodes)

setup_default_handlers()

Setup default telemetry handlers for monitoring.

start_span(event_name, metadata \\ %{})

Instrument a function with start/stop events.

Useful for async operations or when you need more control.

stop_span(event_name, arg, metadata \\ %{})

style_resolution(theme_id, component_type, fun)