Beethoven.Utils (Beethoven v0.3.9)

Module for generic utilities.

Summary

Functions

Gets an environmental variable from beethoven's application config

Toggles the monitoring status of all nodes in the cluster.

Toggles the monitoring status of another node in the cluster.

Performs a backoff based on a random number within a provided range. Time will be used as milliseconds. Returns time waited with :ok atom.

Fn to streamline execution of functions on other nodes in the cluster.

Functions

get_app_env(envVar, default \\ nil)

Gets an environmental variable from beethoven's application config

monitor_all_nodes(mode)

@spec monitor_all_nodes(boolean()) :: :ok

Toggles the monitoring status of all nodes in the cluster.

monitor_node(nodeName, mode)

@spec monitor_node(node(), boolean()) :: :ok

Toggles the monitoring status of another node in the cluster.

random_backoff(range)

@spec random_backoff(Range.t()) :: {:ok, integer()}

Performs a backoff based on a random number within a provided range. Time will be used as milliseconds. Returns time waited with :ok atom.

remote_call(fun, host, timeout \\ 1000)

@spec remote_call((-> any()), node(), integer()) :: any() | {:error, :timeout}

Fn to streamline execution of functions on other nodes in the cluster.