PhoenixGenApiTui.Introspection (phoenix_gen_api_tui v0.1.0)

Copy Markdown View Source

Loads PhoenixGenApi runtime config data into a navigable data structure.

All data comes from PhoenixGenApi.ConfigDb and PhoenixGenApi.Diagnostics at runtime. No compile-time domains like Ash — this reads the live configuration from the running application.

Supports local and remote (distributed) node queries. When a remote node is specified, all data is fetched via RPC to that node.

Includes caching with TTL to avoid excessive RPC calls and graceful degradation when subsystems are unavailable.

Summary

Functions

Loads all introspection data from the running PhoenixGenApi application. Returns a %PhoenixGenApiTui.Introspection{} struct with load status.

Forces a fresh load of all introspection data, bypassing cache.

Loads with optional cache. If cache is nil, always fetches fresh data. Otherwise returns cached data if still fresh. Caches regardless of status (:ok, :partial, :error) to avoid hammering unavailable subsystems.

Checks if the introspection data needs refreshing based on TTL.

Returns the load status of the introspection data.

Types

t()

@type t() :: %PhoenixGenApiTui.Introspection{
  call_flows: term(),
  cluster_view: term(),
  failed_configs: term(),
  health_check: term(),
  loaded_at: term(),
  node: term(),
  rate_limits: term(),
  services: term(),
  statistics: term(),
  status: term(),
  system_info: term()
}

Functions

load(opts \\ [])

Loads all introspection data from the running PhoenixGenApi application. Returns a %PhoenixGenApiTui.Introspection{} struct with load status.

load!(opts \\ [])

Forces a fresh load of all introspection data, bypassing cache.

load_with_cache(cache, opts)

Loads with optional cache. If cache is nil, always fetches fresh data. Otherwise returns cached data if still fresh. Caches regardless of status (:ok, :partial, :error) to avoid hammering unavailable subsystems.

stale?(arg1)

@spec stale?(t() | nil) :: boolean()

Checks if the introspection data needs refreshing based on TTL.

status(arg1)

@spec status(t() | nil) :: :ok | :partial | :error | nil

Returns the load status of the introspection data.