1.5.0 • Published 3 months ago

hyperdht-stats v1.5.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 months ago

HyperDHT Stats

HyperDHT stats, with Prometheus support.

Install

npm i hyperdht-stats

Example

To use with Prometheus:

const Hyperdht = require('Hyperdht')
const DhtStats = require('hyperdht-stats')
const promClient = require('prom-client')

const dht = new Hyperdht()
const stats = new DhtStats(swarm)

stats.registerPrometheusMetrics(promClient)

// In practice metrics are exposed to a metrics scraper
// over a server, but to illustrate we just print them
const metrics = await promClient.register.metrics()
console.log(metrics)

Usage Without Prometheus

dhtStats.toString() returns a string overview of all stats.

1.2.0

7 months ago

1.5.0

3 months ago

1.4.0

5 months ago

1.3.0

6 months ago

1.2.1

7 months ago

1.1.0

9 months ago

1.0.0

9 months ago