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

View Source

Configuration management for the Raxol metrics system.

This module handles:

  • Environment-based configuration
  • Runtime configuration updates
  • Configuration validation
  • Default settings

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns the default configuration.

Gets the current environment.

Gets the current configuration value for the given key.

Gets all current configuration values.

Resets the configuration to default values.

Sets a specific configuration value.

Sets the current environment.

Updates the configuration with the given key-value pairs.

Validates the given configuration. Returns :ok if valid, {:error, reason} if invalid.

Types

config_key()

@type config_key() ::
  :retention_period
  | :max_samples
  | :flush_interval
  | :enabled_metrics
  | :aggregation_window
  | :storage_backend
  | :retention_policies

metric_type()

@type metric_type() :: :performance | :resource | :operation | :system | :custom

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

default_config()

Returns the default configuration.

environment()

Gets the current environment.

get(key, default \\ nil)

Gets the current configuration value for the given key.

get_all()

Gets all current configuration values.

handle_manager_cast(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.

handle_manager_info(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.

reset()

Resets the configuration to default values.

set(key, value)

Sets a specific configuration value.

set_environment(env)

Sets the current environment.

start_link(init_opts \\ [])

update(config_updates)

Updates the configuration with the given key-value pairs.

validate_config(config)

Validates the given configuration. Returns :ok if valid, {:error, reason} if invalid.