TermUI.Widgets.ClusterDashboard (TermUI v0.2.0)
View SourceClusterDashboard widget for visualizing distributed Erlang clusters.
ClusterDashboard displays cluster connectivity, node health metrics, cross-node process registries, and connection events. It provides tools for monitoring and debugging distributed BEAM applications.
Usage
ClusterDashboard.new(
update_interval: 2000,
show_health_metrics: true,
show_pg_groups: true
)Features
- Connected nodes list with status indicators
- Node health metrics (CPU, memory, scheduler utilization)
- Cross-node process registry (:global names)
- PG group membership visualization
- Network partition detection and alerts
- Node connection/disconnection event log
- RPC interface for remote node inspection
Keyboard Controls
- Up/Down: Navigate node/item list
- PageUp/PageDown: Scroll by page
- Enter: Toggle details panel
- r: Refresh now
- g: Show :global names view
- p: Show :pg groups view
- n: Show nodes view
- e: Show events view
- i: Inspect selected node (RPC details)
- Escape: Close details
Summary
Functions
Check if cluster is distributed.
Get currently selected node.
Creates new ClusterDashboard widget props.
Get node count.
Force refresh the cluster data.
Perform RPC call to a node with timeout.
Set the update interval.
Types
@type node_event() :: %{ node: node(), event: :nodeup | :nodedown, timestamp: DateTime.t() }
@type node_info() :: %{ node: node(), status: node_status(), connected_at: DateTime.t() | nil, metrics: map() | nil }
@type node_status() :: :connected | :disconnected | :local
@type view_mode() :: :nodes | :globals | :pg_groups | :events
Functions
Check if cluster is distributed.
Get currently selected node.
Creates new ClusterDashboard widget props.
Options
:update_interval- Refresh interval in ms (default: 2000):show_health_metrics- Fetch and show CPU/memory/load (default: true):show_pg_groups- Show :pg process groups (default: true):show_global_names- Show :global registered names (default: true):on_node_select- Callback when node is selected
@spec node_count(map()) :: non_neg_integer()
Get node count.
Force refresh the cluster data.
Perform RPC call to a node with timeout.
@spec set_interval(map(), non_neg_integer()) :: {:ok, map()}
Set the update interval.