# `Monitorex.ClusterPage`

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.

# `count_recent_inbound`

```elixir
@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`

```elixir
@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`

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

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

# `list_consumers_for_route`

```elixir
@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`

```elixir
@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`

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

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

# `list_recent_inbound`

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

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

# `list_recent_outbound`

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

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

# `list_routes`

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

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
