Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate trackers, fixes #4 #5

Merged
merged 1 commit into from
Oct 11, 2018
Merged

Deduplicate trackers, fixes #4 #5

merged 1 commit into from
Oct 11, 2018

Conversation

valpackett
Copy link
Contributor

I'm not actually sure whether we need to sum up the DownloadCount or just ignore the duplicates…

@metalmatze
Copy link
Owner

So this fix is just about the download count, which was previously the sum of all trackers?

@valpackett
Copy link
Contributor Author

It's about duplicate entries in TrackerStats, by using a hash map the entries are deduplicated and the #4 error is prevented

@metalmatze
Copy link
Owner

Alright, I can recreate the issue on my machine now, thanks for the help.

I have a lot of counters that are -1. I think we should update the PR to set those to 0.

transmission_torrent_downloads_total{id="2",name="pwned-passwords-2.0.txt.7z",tracker="udp://tracker.zer0day.to:1337"} -1
transmission_torrent_downloads_total{id="2",name="pwned-passwords-2.0.txt.7z",tracker="udp://tracker1.wasabii.com.tw:6969"} -1
...
transmission_torrent_leechers{id="2",name="pwned-passwords-2.0.txt.7z",tracker="udp://tracker.zer0day.to:1337"} -1
transmission_torrent_leechers{id="2",name="pwned-passwords-2.0.txt.7z",tracker="udp://tracker1.wasabii.com.tw:6969"} -1
...
transmission_torrent_seeders{id="2",name="pwned-passwords-2.0.txt.7z",tracker="udp://tracker.zer0day.to:1337"} -1
transmission_torrent_seeders{id="2",name="pwned-passwords-2.0.txt.7z",tracker="udp://tracker1.wasabii.com.tw:6969"} -1

Otherwise this looks good to me.

@jonnrb
Copy link

jonnrb commented Apr 9, 2018

I didn’t notice this until now, but I think the dups are due to udp and http trackers with the same fqdn in one torrent. Should those be treated as the same tracker in the stats? Might it be a good future improvement to add a label for the protocol used?

@metalmatze
Copy link
Owner

I'll merge this and then do some more testing with it. Thanks and sorry for the huge delay!

@metalmatze metalmatze merged commit 1652e5f into metalmatze:master Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants