@libp2p/simple-metrics
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

@libp2p/simple-metrics

libp2p.io Discuss codecov CI

Simple in-memory metrics gathering for libp2p

About

Stores metrics in memory and periodically invokes a configured callback to receive them.

Example

import { createLibp2p } from 'libp2p'
import { simpleMetrics } from '@libp2p/simple-metrics'

const node = await createLibp2p({
  // ... other options
  metrics: simpleMetrics({
    onMetrics: (metrics) => {
      // do something with metrics
    }
  }),
  intervalMs: 1000 // default 1s
})

Install

$ npm i @libp2p/simple-metrics

Browser <script> tag

Loading this module through a script tag will make it's exports available as Libp2pSimpleMetrics in the global namespace.

<script src="https://unpkg.com/@libp2p/simple-metrics/dist/index.min.js"></script>

API Docs

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Readme

Keywords

none

Package Sidebar

Install

npm i @libp2p/simple-metrics

Weekly Downloads

335

Version

1.1.0

License

Apache-2.0 OR MIT

Unpacked Size

44.3 kB

Total Files

10

Last publish

Collaborators

  • jacobheun
  • npm-service-account-libp2p
  • alanshaw
  • vascosantos
  • achingbrain
  • daviddias