Entropy (Entropy v0.1.0)

View Source

The public interface for the Entropy system.

This module serves as the primary entry point for controlling the chaos daemon and querying its operational status. It abstracts the underlying GenServer calls to the Entropy.State namespace.

Purpose

  • Status Reporting: Query the liveness and safety state of the system.
  • Runtime Control: Trigger configuration reloads without restarting the node.

Summary

Functions

Determines if the Entropy supervision tree is active.

Determines if the system environment permits fault injection.

Reloads runtime configuration parameters.

Functions

is_alive?()

@spec is_alive?() :: boolean()

Determines if the Entropy supervision tree is active.

Returns true if the Entropy.Supervisor process exists and is alive, otherwise false.

is_ready?()

@spec is_ready?() :: boolean()

Determines if the system environment permits fault injection.

Queries the CircuitBreaker to verify that system metrics (CPU, Memory) are within defined safety thresholds.

Returns true only if the circuit breaker reports a safe state.

reload_config()

@spec reload_config() :: :ok

Reloads runtime configuration parameters.

Fetches the latest values from Entropy.Config and pushes updates to:

  1. Scheduler: Updates the injection frequency (injection_interval_ms).
  2. CircuitBreaker: Updates safety thresholds (max_cpu_util_percent, max_memory_util_percent).

This function allows tuning the aggression of the tool without a restart.