-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add the Popularity metric #20180
Add the Popularity metric #20180
Conversation
@Jamim |
src/base/bittorrent/torrent.h
Outdated
@@ -129,6 +129,7 @@ namespace BitTorrent | |||
static const qreal MAX_RATIO; | |||
static const int MAX_SEEDING_TIME; | |||
static const int MAX_INACTIVE_SEEDING_TIME; | |||
static const qreal INTEREST_RATE_PERIOD; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe that it should be declared public. Just move its declaration in "torrentimpl.cpp".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! INTEREST_RATE_PERIOD
has been renamed to MONTH_SECONDS
and moved to torrentimpl.cpp
.
src/base/bittorrent/torrentimpl.cpp
Outdated
qreal TorrentImpl::interestRate() const | ||
{ | ||
qlonglong elapsed = activeTime(); | ||
return elapsed ? realRatio() / (elapsed / INTEREST_RATE_PERIOD) : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discourage to use numbers as booleans.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't elapsed
ever be zero?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discourage to use numbers as booleans.
A comparison to zero has been added.
Can't
elapsed
ever be zero?
Yes, it's zero in case a torrent is added but not yet started due to the Start torrent
checkbox was toggled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't elapsed ever be zero?
Oops, i was asking for division by zero but didn't pay attention to the left side.
43d4025
to
f30ed42
Compare
100 GB / 10 GB / 2 months = 5 You don't like big torrents huh :) |
Being as helpful for the community while using only 1/10 of the volume is an appealing option π |
Well, I am from Finance World and find this analogy to be a bit hilarious. Probably a better naming would be just "interest" or "Popularity". Nice idea, though. |
f30ed42
to
b33245e
Compare
Thank you @Mazino-Urek and @LordNyriox for suggesting a better name! ππ»ββοΈ |
Maybe I just don't understand something, or it's because I'm not familiar with its use, but will Popularity have the expected value if, for example, a torrent reached a large ratio (say 10.0) in the first month after it was added, and then it had it (almost) unchanged for several months? |
IMO "popularity" would be (finished or active time / time spent actually seeding) or something of the sort and maybe put the month somewhere in there. |
Hello @glassez,
Based on your input, I've prepared a script that draws a plot which shows a correlation between Regarding expectations, the values look fine to me β |
Hello @thalieht,
By actually seeding, do you mean time while data was actively uploaded after completion of downloading, excluding idle? If so, I'm not sure how to receive such information.
That's true. I understand there's no perfect formula for the popularity, but at least it's a good starting point and the initial formula might be changed based on user feedback in the future. |
Yep.
Wow. I was sure libtorrent would have such a counter but i can't find anything. Let's forget about it then. |
In order to gather some additional feedback, I've submitted a post to Reddit: |
b33245e
to
0de8877
Compare
0de8877
to
ceb7098
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably the last comment, other code looks fine.
ps. I didn't consider the usefulness of this metric, I'll leave it for others to decide.
src/gui/transferlistmodel.cpp
Outdated
@@ -171,6 +171,7 @@ QVariant TransferListModel::headerData(const int section, const Qt::Orientation | |||
case TR_DLSPEED: return tr("Down Speed", "i.e: Download speed"); | |||
case TR_UPSPEED: return tr("Up Speed", "i.e: Upload speed"); | |||
case TR_RATIO: return tr("Ratio", "Share ratio"); | |||
case TR_POPULARITY: return tr("Popularity", "Ratio / Time Active (in months), indicates how popular the torrent is"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case TR_POPULARITY: return tr("Popularity", "Ratio / Time Active (in months), indicates how popular the torrent is"); | |
case TR_POPULARITY: return tr("Popularity"); |
The second parameter is for translation disambiguation so you don't need it.
However I think you should move the explanation of the metric to a tooltip (preferably in both GUI and WebUI). The tooltip can be set on the label.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've applied your suggestion. Now I'm working on adding tooltips.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity. |
fb59678
to
1bcd2d5
Compare
I believe it would be nice to have a metric that shows how popular a torrent is. It's especially helpful for clean up purposes if you want to delete the least popular torrents. Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
1bcd2d5
to
3254082
Compare
@Jamim |
Is this metric also seen on public torrents? Maybe thats a bad idea since public torrents often already has low health/popularity and this will make it worse. Only show the metric for private torrents and for public torrents show 'N/A' or 'public' (or something similar). |
Hello @sp33dy85, Thank you for the feedback! ππΌ
This metric is available on any torrent in the client.
Do you mean that revealing this metric to users will push them to make rare torrents extinct by deleting them? If so, I believe that users deserve to have an ability to make an informed decision. |
I think that all_time_upload / size / (activeTime() / MONTHS_SECONDS) would be more useful. Let's say you download and seed a multi-season TV show and sometimes a new episode arrives. You delete an old torrent keeping files on disk. Then get a new torrent, it rechecks and downloads a new episode only (since other ones are already downloaded). So your all_time_download for this new torrent will be relatively small and have no correlation with a size of entire torrent. Thus making "popularity" for this torrent incorrectly high. |
You can edit the |
Or simply add a torrent that you already have as files (the torrent created by you, for example). It will have total_downloaded = 0 and popularity = infinity probably. Not good. |
I've had a thought on this. Is there a way to have it so that popularity will give an "N/A" or "Not Meet" for any torrent that has been active for under 1 month? That way I know what's gotten stale and what hasn't after the 30 days. Or maybe even have that as a configurable time period on the end user? |
Hello,
Thank you for this amazing torrent client! ππ»ββοΈ
I believe it would be nice to have a metric that shows how popular a torrent is.
It's especially helpful for clean up purposes if you want to delete the least popular torrents.
So I'd like to suggest an implementation of the
Popularity
metric.Popularity
A new metric is inspired by the Interest Rate from the finance world.
An implementation is adapted to the use-case and has nothing to do with money.
Popularity
is an average number that represents how many times a torrent is seeded back on a monthly basis calculated asall_time_upload / all_time_download / (activeTime() / MONTHS_SECONDS)
, translated torealRatio() / activeMonths
for simplicity. The resulting values are reasonably small and easy to comprehend, just as for the classicRatio
metric.Metric's name might be different, but I've kept it due to lack of creativity π€·π»ββοΈThanks to @Mazino-Urek and @LordNyriox for suggesting a better name!
Screenshots
Native UI
Web UI
Best regards!