dumpNetworkMetrics and dumpNetworkStats are today the only source of network observability, but they are built as human diagnostic dumps, not as an API:
-
Wrong key space. Results are keyed by kitsune SpaceId and transport pub keys / peer URLs, not DnaHash and AgentPubKey. A client must reverse-engineer the correlation itself.
-
Too expensive to poll. Inside the conductor each call runs a serial per-DNA loop over the app's cells (conductor.rs:2509-2567 as of 0.7), and nothing coordinates or throttles polling across clients.
-
Untyped payloads. Portions of the dump arrive as nested JSON strings that clients must double-parse
Proposal:
- Return metrics keyed by DnaHash/CellId and AgentPubKey, with the transport-level identifiers included alongside rather than instead. The conductor holds the space_id ↔ DNA and agent↔transport mappings; clients should never re-derive them. (This becomes mandatory under the access4 design, where space_id is one-way derived from the DNA hash and clients cannot reverse it.)
- Make the common read cheap: cache/snapshot metrics conductor-side so a per-cell query doesn't walk every cell, or better, offer a subscription (emit on change / at a fixed cadence) so clients stop polling entirely.
- Replace stringly-typed payloads with structured types in holochain_conductor_api (which also gets them into the TS bindings via ts_rs).
Related: holochain/holochain#4664 (dump_* should return structs, not serialized strings — this issue is the network-specific superset), holochain/holochain#3315 (network info wish list), holochain/holochain#5134 (expose access metrics — will land in this same API surface and should follow the same conventions), kitsune2#266. Complements the per-cell sync-status API proposal: that one covers "is this cell healthy/synced", this one covers the underlying metrics plumbing being correct and affordable.
dumpNetworkMetricsanddumpNetworkStatsare today the only source of network observability, but they are built as human diagnostic dumps, not as an API:Wrong key space. Results are keyed by kitsune
SpaceIdand transport pub keys / peer URLs, notDnaHashandAgentPubKey. A client must reverse-engineer the correlation itself.Too expensive to poll. Inside the conductor each call runs a serial per-DNA loop over the app's cells (conductor.rs:2509-2567 as of 0.7), and nothing coordinates or throttles polling across clients.
Untyped payloads. Portions of the dump arrive as nested JSON strings that clients must double-parse
Proposal:
Related: holochain/holochain#4664 (dump_* should return structs, not serialized strings — this issue is the network-specific superset), holochain/holochain#3315 (network info wish list), holochain/holochain#5134 (expose access metrics — will land in this same API surface and should follow the same conventions), kitsune2#266. Complements the per-cell sync-status API proposal: that one covers "is this cell healthy/synced", this one covers the underlying metrics plumbing being correct and affordable.