Raxol.Core.Metrics (Raxol v2.6.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

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()}

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")