1.2.0 • Published 4 months ago

hyperswarm-stats v1.2.0

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

Hyperswarm Stats

Stats for Hyperswarm, with Prometheus support.

Install

npm i hyperswarm-stats

Example

To use with prometheus:

const Hyperswarm = require('hyperswarm')
const HyperswarmStats = require('hyperswarm-stats')
const promClient = require('prom-client')

const swarm = new Hyperswarm()
const stats = new HyperswarmStats(swarm)

stats.registerPrometheusMetrics(promClient)

// In practice metrics are exposed to a metrics scraper
const metrics = await promClient.register.metrics()
console.log(metrics)

Usage Without Prometheus

swarmStats.toString() returns a string overview of all hyperswarm and DHT stats.

1.2.0

4 months ago

1.1.4

8 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.1.3

9 months ago

1.1.2

10 months ago

1.0.1

11 months ago

1.0.0

11 months ago