Bloccs.Introspect.Network (bloccs v0.2.0)

Copy Markdown View Source

A normalized, runtime view of a running network — the single shape an observability tool reads. Assembled by Bloccs.Introspect.network/1 from the generated supervisor and each node's compiled manifest.

Summary

Types

A node's notation glyph (see Bloccs.Introspect.glyph/1).

A node's drawable identity: kind + the canonical notation glyph.

t()

Types

edge_view()

@type edge_view() :: %{from: endpoint(), to: endpoint()}

endpoint()

@type endpoint() :: {atom(), atom()}

glyph()

@type glyph() ::
  :node
  | :node_effect
  | :source
  | :sink
  | :split
  | :batch
  | :join
  | :throttle
  | :delay

A node's notation glyph (see Bloccs.Introspect.glyph/1).

node_view()

@type node_view() :: %{
  id: atom(),
  kind: :source | :transform | :router | :sink,
  glyph: glyph(),
  ports_in: [port_view()],
  ports_out: [port_view()],
  effects: [:http | :db | :time | :random],
  concurrency: pos_integer(),
  doc: %{intent: String.t() | nil, owner: String.t() | nil}
}

A node's drawable identity: kind + the canonical notation glyph.

port_view()

@type port_view() :: %{name: atom(), schema: String.t(), buffer: pos_integer() | nil}

summary()

@type summary() :: %{
  id: atom(),
  version: String.t(),
  node_count: non_neg_integer(),
  edge_count: non_neg_integer(),
  started_at: integer(),
  supervisor: module()
}

t()

@type t() :: %Bloccs.Introspect.Network{
  edges: [edge_view()],
  expose: %{in: map(), out: map()},
  id: atom(),
  nodes: [node_view()],
  started_at: integer() | nil,
  supervision: %{
    strategy: atom(),
    max_restarts: non_neg_integer(),
    max_seconds: pos_integer()
  },
  supervisor: module(),
  version: String.t()
}