Monitorex.ClusterPage (monitorex v0.3.0)

Copy Markdown

Helper that delegates to Monitorex.Cluster (multi-node) or Monitorex.Storage (local) based on the :cluster_mode config.

Used by LiveView pages to transparently aggregate data across BEAM nodes when running in cluster mode, while falling back to local reads when in :single mode (the default).

Config

Set Application.get_env(:monitorex, :cluster_mode) to one of:

  • :single — read from local ETS tables only (default)
  • :auto — use Cluster if more than one node is visible
  • :cluster — always use Cluster (multi-node RPC)

See Monitorex.Cluster for detailed merge strategies and configuration options.

Summary

Functions

Returns count of recent inbound events — either from local Storage or summed across all cluster nodes.

Returns count of recent outbound events — either from local Storage or summed across all cluster nodes.

Returns consumers — either from local Storage or aggregated across all cluster nodes.

Returns consumers for a route — either from local Storage or aggregated across all cluster nodes.

Returns endpoints for a host — either from local Storage or aggregated across all cluster nodes.

Returns hosts — either from local Storage or aggregated across all cluster nodes.

Returns recent inbound events — either from local Storage or merged across all cluster nodes.

Returns recent outbound events — either from local Storage or merged across all cluster nodes.

Returns routes — either from local Storage or aggregated across all cluster nodes.

Functions

count_recent_inbound(opts \\ [])

@spec count_recent_inbound(keyword()) :: non_neg_integer()

Returns count of recent inbound events — either from local Storage or summed across all cluster nodes.

count_recent_outbound(opts \\ [])

@spec count_recent_outbound(keyword()) :: non_neg_integer()

Returns count of recent outbound events — either from local Storage or summed across all cluster nodes.

list_consumers()

@spec list_consumers() :: [map()]

Returns consumers — either from local Storage or aggregated across all cluster nodes.

list_consumers_for_route(route)

@spec list_consumers_for_route(String.t()) :: [map()]

Returns consumers for a route — either from local Storage or aggregated across all cluster nodes.

list_endpoints_for_host(host)

@spec list_endpoints_for_host(String.t()) :: [map()]

Returns endpoints for a host — either from local Storage or aggregated across all cluster nodes.

list_hosts()

@spec list_hosts() :: [map()]

Returns hosts — either from local Storage or aggregated across all cluster nodes.

list_recent_inbound(opts \\ [])

@spec list_recent_inbound(keyword()) :: [map()]

Returns recent inbound events — either from local Storage or merged across all cluster nodes.

list_recent_outbound(opts \\ [])

@spec list_recent_outbound(keyword()) :: [map()]

Returns recent outbound events — either from local Storage or merged across all cluster nodes.

list_routes()

@spec list_routes() :: [map()]

Returns routes — either from local Storage or aggregated across all cluster nodes.