Next-depth pass: network-stack, CRDTs, gossip, scheduling, experimental
Expand introspection helpers and getStats(protocol) across six categories after the storage/trust giant pass. network-stack (10): listPeerIds, hasPeer, bestPeer, listCircuitIds, queueDepth, listPendingIds, and related helpers; protocol in getStats. state-crdts: crdt-map has/size/entries; conflict-set size/isEmpty; reactive-state size/keys; richer getStats on map and conflict-set. messaging-gossip: gossip-mesh seenCount/clearSeen; dedup size/clear; event-bus getStats merges metrics/topics/peers. scheduling-queues: topic-lease listShards/isHeld; peer-scheduler listJobs; activity-queue pending/claimed stats. measurement-rate-control: bucket-rate listPeerIds/peerCount. experimental (16): protocol-rich getStats; mycelium listPeerIds/totalCredits; pheromone listPathIds. Docs: API Methods for link-probe, crdt-map, gossip-mesh; expanded category READMEs for state-crdts, messaging-gossip, scheduling, measurement. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -46,6 +46,10 @@ class HyperP2POverlayTopology extends EventEmitter {
|
||||
return [...this._neighbors.values()]
|
||||
}
|
||||
|
||||
hasNeighbor (peerId) { return this._neighbors.has(peerId) }
|
||||
|
||||
neighborCount () { return this._neighbors.size }
|
||||
|
||||
suggestReplacement (failedPeer) {
|
||||
if (!failedPeer) throw new Error('failedPeer required')
|
||||
let best = null
|
||||
@@ -57,7 +61,9 @@ class HyperP2POverlayTopology extends EventEmitter {
|
||||
return best
|
||||
}
|
||||
|
||||
getStats () { return { ...this._stats, degree: this._neighbors.size } }
|
||||
getStats () {
|
||||
return { ...this._stats, degree: this._neighbors.size, protocol: PROTOCOL }
|
||||
}
|
||||
|
||||
async ready () {
|
||||
if (this.swarm || !this.topic) return this
|
||||
|
||||
Reference in New Issue
Block a user