Raxol.Core.Metrics (Raxol v2.8.0)

View Source

Core metrics module for Raxol framework.

Provides metrics collection and recording with timeout-guarded calls to underlying collectors. Metrics are non-critical -- failures are swallowed where appropriate.

Summary

Functions

Starts the metrics collector.

Records a metric with the given name, value, and optional tags.

Functions

clear_metrics()

@spec clear_metrics() ::
  :ok | {:error, {:metrics_clear_failed, :timeout | {term(), term()}}}

get_metrics()

@spec get_metrics() ::
  {:ok, map()} | {:error, {:metrics_get_failed, :timeout | {term(), term()}}}

init(options \\ [])

@spec init(keyword()) :: :ok | {:error, term()}

Starts the metrics collector.

Raxol.Core.Metrics.Aggregator and Raxol.Core.Metrics.AlertManager are opt-in servers that the caller starts itself; see the metrics README.

record(name, value, tags \\ [])

@spec record(String.t(), any(), keyword()) :: :ok

Records a metric with the given name, value, and optional tags.

Example

Raxol.Core.Metrics.record("render_time", 150, component: "table")