These are chat archives for anacrolix/torrent

8th
Jun 2017
Matt Joiner
@anacrolix
Jun 08 2017 01:06
yeah that's definitely missing. by peers do you mean active connections? because it would be non-trivial to track all peers seen, lots of memory use etc.
but something like Torrent.ConnStats() []ConnStat could work
Samuel
@iamacarpet
Jun 08 2017 07:02
Yes active connections, it wouldn't need to be a history of all seen or spoken to before. To be honest, it's more about differentiating between peers that are seeds (100% done) and leeches (still downloading). Not sure what you've got to check from those remote peers to work that out, but pretty much the same int variables in TorrentStats but split out into the two groups, to match what you'd usually see in a torrent client, or what Quasar used to show.
It's useful as I guess if your download is stuck and you can see there are no seeds connected just peers, you haven't got much chance of it completing quickly.
Matt Joiner
@anacrolix
Jun 08 2017 08:49
yeah sounds good
Samuel
@iamacarpet
Jun 08 2017 08:50
I tried to look up the BitTorrent protocol this morning but couldn't see where you grab the peers download status. Any idea if that's something you already do?
Matt Joiner
@anacrolix
Jun 08 2017 08:51
yeah it's definitely something that's already in the code, assuming you mean what pieces each peer has etc.
can u list the data points you want for each conn?
Samuel
@iamacarpet
Jun 08 2017 09:32
Ideally what we want to end up with is like this ( @elgatito can you please help confirm? ):

type TorrentStats struct {
ConnStats // Aggregates stats over all connections past and present.

ActivePeers     int
HalfOpenPeers   int
PendingPeers    int
TotalPeers      int

ActiveSeeds     int
TotalSeeds      int

ActiveLeechers  int
TotalLeechers   int

}

Per connection, I assume that'll mean noting if the peer is a seed or not, perhaps as a bool, but only to include it in these totals?
I haven't seen the code that updates the totals so I wouldn't like to comment too much.
And I assume the total seeds & total peers would reflect the numbers given by (tracker + dht + peer-exchange)
Denis
@elgatito
Jun 08 2017 10:04
Yes, somrthing like that. Some peers are both incoming/outcoming
Greg Lutostanski
@lutostag
Jun 08 2017 23:31
hey @anacrolix, I was gonna try to take a stab at #116 if you can get me started on the more in-depth bits...