Skip to content

Stats for Hyperswarm and the connections it swarms, with Prometheus support

License

Notifications You must be signed in to change notification settings

holepunchto/hyperswarm-stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Stats for Hyperswarm and the connections it swarms, with Prometheus support

Resources

License

Stars

Watchers

Forks

Packages

No packages published