Creates a PeerMap that reports it's size to the libp2p Metrics service
Copy
import { trackedPeerMap } from '@libp2p/peer-collections' import { createLibp2p } from 'libp2p'
const libp2p = await createLibp2p()
const list = trackedPeerMap({ name: 'my_metric_name', metrics: libp2p.metrics }) map.set(peerId, 'value') ```
Creates a PeerMap that reports it's size to the libp2p Metrics service