Raxol.Metrics (Raxol v0.3.0)

View Source

Handles collection and management of system metrics.

This module is responsible for collecting and managing various system metrics including:

  • CPU usage
  • Memory usage
  • Active sessions
  • Database connections
  • Response times
  • Error rates

Summary

Functions

Returns a specification to start this module under a supervisor.

Records a gauge metric value.

Returns the current metrics.

Increments a counter metric.

Callback implementation for GenServer.init/1.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

gauge(name, value)

Records a gauge metric value.

Parameters

  • name: The name of the metric
  • value: The value to record for the metric

Examples

Raxol.Metrics.gauge("raxol.chart_render_time", 42.5)

get_active_sessions()

get_cpu_usage()

get_current_metrics()

Returns the current metrics.

Returns a map containing the current system metrics.

get_memory_usage()

increment(name)

Increments a counter metric.

Parameters

  • name: The name of the metric to increment

Examples

Raxol.Metrics.increment("raxol.chart_cache_hits")

init(_)

Callback implementation for GenServer.init/1.

start_link(_)