Novage / wt-tracker

High-performance WebTorrent tracker
Apache License 2.0
244 stars 86 forks source link

Is it possible to not show 'peersCountPerInfoHash' ? #78

Open stevenking888 opened 3 weeks ago

stevenking888 commented 3 weeks ago

Hello,

After I update to the latest version I found that stats.json has addition info peersCountPerInfoHash when connection is hight it's seem to slow down stats.json. Is it possible to disable it for showing ?

Regards, Steven

mrlika commented 2 weeks ago

It is not possible to configure stats.json, but it can be disabled by commenting on two lines of code in run-uws-tracker.ts:

        // const infoHashHex = Buffer.from(infoHash, "binary").toString("hex");
        // peersCountPerInfoHash[infoHashHex] = swarm.peers.length;

https://github.com/Novage/wt-tracker/blob/4c9f68d06692e02989c1aa5ac84bda6e76cd364a/src/run-uws-tracker.ts#L246