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

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.

Resets the configuration to default values.

Sets the current environment.

Starts the configuration server.

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

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.

reset()

Resets the configuration to default values.

set_environment(env)

Sets the current environment.

start_link(opts \\ [])

Starts the configuration server.

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.