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