Raxol.Core.Metrics.UnifiedCollector (Raxol v0.5.0)

View Source

Manages unified metrics collection across the application.

Summary

Functions

Calculates the average of a metric.

Calculates the maximum value of a metric.

Calculates the minimum value of a metric.

Calculates the sum of a metric.

Clears all metrics.

Collects metrics from all registered collectors.

Gets all metrics.

Gets a collector.

Gets all collectors.

Gets a metric value.

Gets metrics for a specific metric name and tags.

Gets the time since the last update.

Gets the total runtime of the collector.

Creates a new unified collector.

Records a metric value.

Removes a collector.

Types

t()

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

Functions

add_collector(collector, name, collector_module)

Adds a collector.

calculate_average(collector, name)

Calculates the average of a metric.

calculate_max(collector, name)

Calculates the maximum value of a metric.

calculate_min(collector, name)

Calculates the minimum value of a metric.

calculate_sum(collector, name)

Calculates the sum of a metric.

clear_metrics(collector)

Clears all metrics.

collect_metrics(collector)

Collects metrics from all registered collectors.

get_all_metrics(collector)

Gets all metrics.

get_collector(collector, name)

Gets a collector.

get_collectors(collector)

Gets all collectors.

get_metric(collector, name)

Gets a metric value.

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_time_since_last_update(collector)

Gets the time since the last update.

get_total_runtime(collector)

Gets the total runtime of the collector.

new(opts \\ [])

Creates a new unified collector.

record_metric(collector, name, value)

Records a metric value.

remove_collector(collector, name)

Removes a collector.