Discussion:
[Deluge] #2848: Incorrect share ratio in torrent status
Deluge
2016-06-08 02:00:29 UTC
Permalink
#2848: Incorrect share ratio in torrent status
------------------------------------------------------+-------------------
Reporter: ph33onix | Owner:
Type: bug | Status: new
Priority: minor | Milestone: 1.3.x
Component: Core | Version: 1.3.6
Keywords: share ratio total_done all_time_download |
------------------------------------------------------+-------------------
In /deluge/core/torrent.py, the get_ratio method always uses the
total_done variable even though it has an all_time_download variable
available. Wouldn't it be best to use whichever is greater between
total_done and all_time_download to get the lowest (and safest) ratio?

So:
If the download is new then total_done and all_time_download will be about
the same.
If the download is new but some files have already been downloaded then
total_done will be used as it will be bigger than all_time_download.
If the download is old and we deselect some files(set to not download) and
also delete them then all_time_download will be used as it will be (much)
bigger than total_done. This is the main improvement.

The only problem case is if someone manually adds files to an old torrent.
If the added files bump total_done over all_time_download which means
behaviour is the same as before. If the added files don't bump total_done
over all_time_download then all_time_download is used which is a bigger
number and results in a lower ratio which is closer to the truth. So while
this change doesn't fix this case it still improves it.

Is there anything I'm missing ?

--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2848>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Deluge
2016-06-10 15:20:33 UTC
Permalink
#2848: Incorrect share ratio in torrent status
-------------------------+-------------------------------------------------
Reporter: ph33onix | Owner:
Type: bug | Status: new
Priority: minor | Milestone: 2.0
Component: Core | Version: 1.3.6
Resolution: | Keywords: share ratio total_done
| all_time_download
-------------------------+-------------------------------------------------
Changes (by Cas):

* milestone: 1.3.x => 2.0


Comment:

We can look at it for 2.0

--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2848#comment:1>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Deluge
2017-03-31 10:24:45 UTC
Permalink
#2848: Incorrect share ratio in torrent status
-------------------------+-------------------------------------------------
Reporter: ph33onix | Owner:
Type: bug | Status: new
Priority: minor | Milestone: 2.0
Component: Core | Version: 1.3.6
Resolution: | Keywords: share ratio total_done
| all_time_download
-------------------------+-------------------------------------------------
Post by Deluge
In /deluge/core/torrent.py, the get_ratio method always uses the
total_done variable even though it has an all_time_download variable
available. Wouldn't it be best to use whichever is greater between
total_done and all_time_download to get the lowest (and safest) ratio?
If the download is new then total_done and all_time_download will be
about the same.
If the download is new but some files have already been downloaded then
total_done will be used as it will be bigger than all_time_download.
If the download is old and we deselect some files(set to not download)
and also delete them then all_time_download will be used as it will be
(much) bigger than total_done. This is the main improvement.
The only problem case is if someone manually adds files to an old
torrent. If the added files bump total_done over all_time_download which
means behaviour is the same as before. If the added files don't bump
total_done over all_time_download then all_time_download is used which is
a bigger number and results in a lower ratio which is closer to the
truth. So while this change doesn't fix this case it still improves it.
Is there anything I'm missing ?
New description:

In `/deluge/core/torrent.py`, the `get_ratio` method always uses the
`total_done` variable even though it has an `all_time_download` variable
available.

Wouldn't it be best to use whichever is greater between `total_done` and
`all_time_download` to get the lowest (and safest) ratio?

So:

- If the download is new then `total_done` and `all_time_download` will
be about the same.
- If the download is new but some files have already been downloaded then
total_done will be used as it will be bigger than `all_time_download`.
- If the download is old and we deselect some files(set to not download)
and also delete them then `all_time_download` will be used as it will be
(much) bigger than `total_done`. This is the main improvement.

The only problem case is if someone manually adds files to an old torrent.
If the added files bump `total_done` over `all_time_download` which means
behaviour is the same as before. If the added files don't bump
`total_done` over `all_time_download` then `all_time_download` is used
which is a bigger number and results in a lower ratio which is closer to
the truth. So while this change doesn't fix this case it still improves
it.

Is there anything I'm missing ?

--

--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2848#comment:2>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Deluge
2017-06-25 19:26:43 UTC
Permalink
#2848: Incorrect share ratio in torrent status
-------------------------+-------------------------------------------------
Reporter: ph33onix | Owner:
Type: bug | Status: new
Priority: minor | Milestone: 2.0
Component: Core | Version: 1.3.6
Resolution: | Keywords: share ratio total_done
| all_time_download
-------------------------+-------------------------------------------------

Comment (by Cas):

So it used to be `all_time_download` until:

[8e7d4f2cd47532]
Change share ratio calculation to use the total done instead of the all
time downloaded value. This change will make the share ratio calculation
not use data downloaded in failed hash checks.

[[br]]

I am thinking that `total_wanted_done` is going to be better for torrents
with unwanted files.

----

Reference tickets: #646, #2072 and lt docs:

{{{
total_done
the total number of bytes of the file(s) that we have. All this does
not necessarily has to be downloaded during this session (that's
total_payload_download).

total_wanted_done
the number of bytes we have downloaded, only counting the pieces that
we actually want to download. i.e. excluding any pieces that we have but
have priority 0 (i.e. not wanted).

total_wanted
The total number of bytes we want to download. This may be smaller
than the total torrent size in case any pieces are prioritized to 0, i.e.
not wanted

all_time_upload all_time_download
are accumulated upload and download payload byte counters. They are
saved in and restored from resume data to keep totals across sessions.
}}}

--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2848#comment:3>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Deluge
2017-06-28 10:53:06 UTC
Permalink
#2848: Incorrect share ratio in torrent status
-------------------------+-------------------------------------------------
Reporter: ph33onix | Owner:
Type: bug | Status: closed
Priority: minor | Milestone: 2.0
Component: Core | Version: 1.3.6
Resolution: Fixed | Keywords: share ratio total_done
| all_time_download
-------------------------+-------------------------------------------------
Changes (by Cas):

* status: new => closed
* resolution: => Fixed


Comment:

Changed in develop: [7b87a93862]

--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2848#comment:4>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Deluge
2017-07-07 09:17:08 UTC
Permalink
#2848: Incorrect share ratio in torrent status
-------------------------+-------------------------------------------------
Reporter: ph33onix | Owner:
Type: bug | Status: reopened
Priority: minor | Milestone: 1.3.16
Component: Core | Version: 1.3.6
Resolution: | Keywords: share ratio total_done
| all_time_download
-------------------------+-------------------------------------------------
Changes (by Cas):

* status: closed => reopened
* resolution: Fixed =>
* milestone: 2.0 => 1.3.16


--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2848#comment:5>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Deluge
2017-08-23 12:24:50 UTC
Permalink
#2848: Incorrect share ratio in torrent status
-------------------------+-------------------------------------------------
Reporter: ph33onix | Owner:
Type: bug | Status: reopened
Priority: minor | Milestone: 1.3.16
Component: Core | Version: 1.3.6
Resolution: | Keywords: share ratio total_done
| all_time_download
-------------------------+-------------------------------------------------

Comment (by ph33onix):

The reason I wanted the greater between all_time_download and total_done
was because it would be bigger than total_done and thus a safer ratio
estimation for private trackers.
After reading your comments I see that all_time_download is not what I
thought it was so it shouldn't be used.

However, using total_wanted_done seems even worse with regards to share
ratio on private trackers. You can start a torrent, download some data,
then deselect it and your client will no longer count it as necessary for
the ratio, but the tracker will.

In the case of public trackers, total_wanted_done will more accurately
represent what the user cares about, allowing him to share proportionally
to what he wanted to download.

These are fringe cases so either one can be used without much problem but,
for share ratio safety, total_done seems safer.

--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2848#comment:6>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Deluge
2017-08-23 12:52:15 UTC
Permalink
#2848: Incorrect share ratio in torrent status
-------------------------+-------------------------------------------------
Reporter: ph33onix | Owner:
Type: bug | Status: reopened
Priority: minor | Milestone: 1.3.16
Component: Core | Version: 1.3.6
Resolution: | Keywords: share ratio total_done
| all_time_download
-------------------------+-------------------------------------------------

Comment (by Cas):

If you really feel that it would be worse for private torrents then we can
check for private flag and use a different ratio calculation. What would
you suggest?

--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2848#comment:7>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Deluge
2017-09-11 10:42:54 UTC
Permalink
#2848: Incorrect share ratio in torrent status
-------------------------+-------------------------------------------------
Reporter: ph33onix | Owner:
Type: bug | Status: reopened
Priority: minor | Milestone: 1.3.16
Component: Core | Version: 1.3.6
Resolution: | Keywords: share ratio total_done
| all_time_download
-------------------------+-------------------------------------------------

Comment (by ph33onix):

I wrongly assumed that private trackers will count how many bytes you
download but they don't, they track how many parts(or chunks?) you have,
when you announce it. So using total_done is fine, no change needed.

Checking for private flag and using total_wanted_done for public enables
users to be a bit more selfish. They can start a torrent, let it run for a
bit then deselect the files they don't want and only upload enough to make
up for what they wanted to download. This means they may upload less than
they downloaded, hurting the swarm. So I personally don't think this would
be a good change.

Overall my suggestion is to close this as not a bug.

--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2848#comment:8>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Deluge
2017-10-29 12:40:27 UTC
Permalink
#2848: Incorrect share ratio in torrent status
-------------------------+-------------------------------------------------
Reporter: ph33onix | Owner:
Type: bug | Status: closed
Priority: minor | Milestone: 2.0
Component: Core | Version: 1.3.6
Resolution: Invalid | Keywords: share ratio total_done
| all_time_download
-------------------------+-------------------------------------------------
Changes (by Cas):

* status: reopened => closed
* resolution: => Invalid
* milestone: 1.3.16 => 2.0


Comment:

Reverted in develop: [0ba87b424c6]

--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2848#comment:9>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Loading...