need Peers Count api
Open
exp/novice
kind/enhancement
need/analysis
P3
topic/commands
- Dominant language
- Go
- Stars
- 17.1k
- Forks
- 3.2k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 11
Description
the api lack of Peers Count
because pooling for peers count by getting a full list of peers is not making sense,
```js
const peerInfos = await ipfs.swarm.peers({ timeout: 2500 })
return peerInfos.length
```
especially when the peers is around 6k-7k list... every 2.5s pooling for the long list is consuming CPU inefficiently.
_Originally posted by @thienpow in https://github.com/ipfs/go-ipfs/issues/7528#issuecomment-658686189_
Contributor guide
Assessment
This issue has not been assessed yet.