41 lines
823 B
Markdown
41 lines
823 B
Markdown
# hyper-p2p-health-probe
|
|
|
|
Gossip health reports: ok flag, RTT, and custom fields per peer.
|
|
|
|
**Category:** Observability
|
|
|
|
**Composes with:** `hyper-p2p-log-gossip`, `hyper-p2p-intent-router`
|
|
|
|
**Protocol:** `health-probe/v1`
|
|
|
|
## When to use
|
|
|
|
Mesh liveness dashboards and routing guards on shared topics.
|
|
|
|
## When not to use
|
|
|
|
Deep APM (use trace/metrics modules instead).
|
|
|
|
## Quick start
|
|
|
|
```js
|
|
const { HyperP2PHealthProbe } = require('hyper-p2p-health-probe')
|
|
const probe = new HyperP2PHealthProbe({ topic: 'health-mesh' })
|
|
await probe.ready()
|
|
probe.report('peer-abc', { ok: true, rttMs: 12 })
|
|
console.log(probe.healthyPeers())
|
|
await probe.close()
|
|
```
|
|
|
|
## Docs
|
|
|
|
- [docs/api.md](docs/api.md)
|
|
- [docs/architecture.md](docs/architecture.md)
|
|
- [examples/basic.js](examples/basic.js)
|
|
|
|
## Test
|
|
|
|
```bash
|
|
npm install && npm test
|
|
```
|