Collect libp2p metrics and send them to browser DevTools
Configure your browser-based libp2p node with DevTools metrics:
import { createLibp2p } from 'libp2p'
import { devToolsMetrics } from '@libp2p/devtools-metrics'
const node = await createLibp2p({
metrics: devToolsMetrics()
})
Then use the DevTools plugin for Chrome or Firefox to inspect the state of your running node.
$ npm i @libp2p/devtools-metrics
<script>
tagLoading this module through a script tag will make its exports available as Libp2pDevtoolsMetrics
in the global namespace.
<script src="https://unpkg.com/@libp2p/devtools-metrics/dist/index.min.js"></script>
Licensed under either of
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.