Bloccs.Introspect (bloccs v0.2.0)

Copy Markdown View Source

The read-only introspection API for running networks — the foundation a dashboard (e.g. bloccs_web) reads.

It assembles a normalized Bloccs.Introspect.Network from data the runtime already holds: Bloccs.Discovery (which networks are up), the generated supervisor's __bloccs_introspect__/0 (topology + node→impl + supervision), and each node's __bloccs_manifest__/0 (ports, effects, kind). Liveness comes separately, from the [:bloccs, …] telemetry stream.

Summary

Functions

The canonical notation glyph for a node manifest. Lives here so the notation stays a property of the library, not invented by each viewer. Filter/merge are emergent (return shape / wiring) and not derivable from a single node manifest.

Summaries of every running network (id, version, counts, uptime).

Full normalized topology for one running network.

Snapshot one producer's queue state (size / buffer / blocked / utilization) by its canonical name. Delegates to the safe Bloccs.Producer.stats/1 accessor.

The input producers of a network (one per in-port), with their canonical name and whether the process is currently registered.

Functions

glyph(m)

The canonical notation glyph for a node manifest. Lives here so the notation stays a property of the library, not invented by each viewer. Filter/merge are emergent (return shape / wiring) and not derivable from a single node manifest.

list_networks()

@spec list_networks() :: [Bloccs.Introspect.Network.summary()]

Summaries of every running network (id, version, counts, uptime).

network(network_id)

@spec network(atom()) :: {:ok, Bloccs.Introspect.Network.t()} | {:error, :not_found}

Full normalized topology for one running network.

producer_state(producer_name)

@spec producer_state(atom()) ::
  {:ok, Bloccs.Producer.stats()} | {:error, :not_found | :timeout}

Snapshot one producer's queue state (size / buffer / blocked / utilization) by its canonical name. Delegates to the safe Bloccs.Producer.stats/1 accessor.

producers(network_id)

@spec producers(atom()) :: [
  %{node: atom(), port: atom(), name: atom(), alive?: boolean()}
]

The input producers of a network (one per in-port), with their canonical name and whether the process is currently registered.