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

View Source

Metric aggregation system for the Raxol metrics.

This module handles:

  • Metric aggregation by time windows
  • Statistical calculations (mean, median, percentiles)
  • Metric grouping and categorization
  • Aggregation rules and policies
  • Real-time aggregation updates

Summary

Functions

Adds a new aggregation rule.

Calculates an aggregation of values using the specified method.

Returns a specification to start this module under a supervisor.

Gets aggregated metrics for a specific rule.

Gets all aggregation rules.

Starts the metric aggregator.

Updates aggregation for a specific rule.

Types

aggregation_rule()

@type aggregation_rule() :: %{
  type: aggregation_type(),
  window: time_window(),
  metric_name: String.t(),
  tags: map(),
  group_by: [String.t()]
}

aggregation_type()

@type aggregation_type() :: :sum | :mean | :median | :min | :max | :percentile

time_window()

@type time_window() :: :minute | :hour | :day | :week | :month

Functions

add_rule(rule)

Adds a new aggregation rule.

calculate_aggregation(values, atom)

@spec calculate_aggregation([number()], atom()) :: number()

Calculates an aggregation of values using the specified method.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_aggregated_metrics(rule_id)

Gets aggregated metrics for a specific rule.

get_rules()

Gets all aggregation rules.

start_link(opts \\ [])

Starts the metric aggregator.

update_aggregation(rule_id)

Updates aggregation for a specific rule.