Raxol.Core.Metrics.MetricsCollector (Raxol v2.0.1)

View Source

Manages unified metrics collection across the application.

Summary

Functions

Returns a specification to start this module under a supervisor.

Clears all metrics.

Clears all metrics (with optional parameter for compatibility).

Gets all metrics (alias for get_metrics/0).

Gets a metric value.

Gets all metrics grouped by type.

Gets metrics for a specific metric name and tags.

Gets metrics by type.

Records a custom metric.

Records an operation metric.

Records a performance metric.

Records a performance metric with tags.

Records a resource metric.

Records a resource metric with tags.

Stops the unified collector.

Types

t()

@type t() :: %Raxol.Core.Metrics.MetricsCollector{
  collectors: map(),
  last_update: integer(),
  metrics: map(),
  start_time: integer()
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clear_metrics()

Clears all metrics.

clear_metrics(collector)

Clears all metrics (with optional parameter for compatibility).

get_all_metrics()

Gets all metrics (alias for get_metrics/0).

get_metric(name, type, opts \\ [])

Gets a metric value.

get_metrics()

Gets all metrics grouped by type.

get_metrics(metric_name, tags)

@spec get_metrics(String.t(), map()) :: {:ok, [map()]} | {:error, term()}

Gets metrics for a specific metric name and tags.

get_metrics_by_type(type)

@spec get_metrics_by_type(atom()) :: map()

Gets metrics by type.

record_custom(name, value)

@spec record_custom(String.t() | atom(), number()) :: :ok

Records a custom metric.

record_metric(name, type, value, opts \\ [])

@spec record_metric(atom(), atom(), number(), keyword()) :: :ok

Records a metric value.

record_operation(name, value)

@spec record_operation(atom(), number()) :: :ok

Records an operation metric.

record_performance(name, value)

@spec record_performance(atom(), number()) :: :ok

Records a performance metric.

record_performance(name, value, opts)

@spec record_performance(atom(), number(), keyword()) :: :ok

Records a performance metric with tags.

record_resource(name, value)

@spec record_resource(atom(), number()) :: :ok

Records a resource metric.

record_resource(name, value, opts)

@spec record_resource(atom(), number(), keyword()) :: :ok

Records a resource metric with tags.

start_link(init_opts \\ [])

stop(pid \\ __MODULE__)

Stops the unified collector.