DalaDev.NetworkDiag (dala_dev v0.0.10)

Copy Markdown View Source

Network diagnostics for dala Elixir clusters.

Provides tools to diagnose connectivity issues, measure latency, and verify EPMD health across cluster nodes.

Examples

# Ping a node
{:ok, latency_ms} = DalaDev.NetworkDiag.ping_node(:"dala_qa@192.168.1.5")

# Measure latency with multiple samples
{:ok, stats} = DalaDev.NetworkDiag.measure_latency(node, samples: 100)

# Check EPMD health
:ok = DalaDev.NetworkDiag.check_epmd_health(node)

# Trace distribution path
{:ok, path} = DalaDev.NetworkDiag.trace_distribution(node)

Summary

Functions

Check EPMD health on a node.

Get detailed network interface information for a node.

Measure latency to a node with multiple samples.

Ping a node to check connectivity.

Trace the distribution path to a node.

Types

latency_stats()

@type latency_stats() :: %{
  min: integer(),
  max: integer(),
  avg: float(),
  median: float(),
  samples: integer()
}

node_ref()

@type node_ref() :: node() | DalaDev.Device.t() | String.t()

Functions

check_epmd_health(node_ref, opts \\ [])

@spec check_epmd_health(
  node_ref(),
  keyword()
) :: :ok | {:error, term()}

Check EPMD health on a node.

Verifies:

  • EPMD is running
  • Port 4369 is reachable
  • Node can register/deregister

Returns :ok or {:error, reason}.

get_network_interfaces(node_ref, opts \\ [])

@spec get_network_interfaces(
  node_ref(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Get detailed network interface information for a node.

Returns IP addresses, interface names, and reachability.

measure_latency(node_ref, opts \\ [])

@spec measure_latency(
  node_ref(),
  keyword()
) :: {:ok, latency_stats()} | {:error, term()}

Measure latency to a node with multiple samples.

Options:

  • :samples - Number of ping samples (default: 10)
  • :timeout - Timeout per sample in ms (default: 5_000)

Returns latency statistics.

ping_node(node_ref, opts \\ [])

@spec ping_node(
  node_ref(),
  keyword()
) :: {:ok, integer()} | {:error, term()}

Ping a node to check connectivity.

Returns {:ok, latency_ms} on success, {:error, reason} on failure.

Options:

  • :timeout - Timeout in ms (default: 5_000)

trace_distribution(node_ref, opts \\ [])

@spec trace_distribution(
  node_ref(),
  keyword()
) :: {:ok, [String.t()]} | {:error, term()}

Trace the distribution path to a node.

Shows the network path Elixir distribution takes to reach the node.

Returns a list of hops or error.