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

downloader: don't include completion-rate into download-rate #13044

Closed
AskAlexSharov opened this issue Dec 9, 2024 · 3 comments
Closed

downloader: don't include completion-rate into download-rate #13044

AskAlexSharov opened this issue Dec 9, 2024 · 3 comments
Assignees

Comments

@AskAlexSharov
Copy link
Collaborator

Example start of synced node:

[INFO] [12-09|03:30:33.140] [1/9 OtterSync] Downloading              progress="(1279/1279 files) 61.37% - 1.2TB/1.9TB" rate=60.5GB/s time-left=0hrs:0m total-time=39s download-rate=60.5GB/s completion-rate=60.4GB/s alloc=1.6GB sys=3.2GB

it does re-hash some things: completion-rate > 0
but it including completion-rate into download-rate

also maybe rate is not so useful

@dvovk
Copy link
Member

dvovk commented Dec 16, 2024

The download represents downloaded bytes and completion shows downloaded and hashed. On restart the torrent-lib does re-hash of some part if download doesn't finished. The rate is a value which shows download or completion rate depending on the current state of the downloader. If files don't downloaded it shows download rate if they downloaded it shows completion rate and status changes from Downloading to Verifying. It was done because on slow machines completion can take some time to finish and it appears to user as a stuck at 100% but in fact the torrent-lib was hashing downloaded files (at some case I remember around 20 min on bor). On faster machines download and completion processing at the same time so download and completion shows the same values. My proposal was to left only rate in logs. I don't remember why we decided to keep download and completion printing.

@AskAlexSharov
Copy link
Collaborator Author

I know what it means - just it feels redundant (not sure if it adds more clarity for user or adds more mess):
downloading=100Kb/s hashing=20kb/s vs rate=120Kb/s downloading=100Kb/s hashing=20kb/s
downloading=0Kb/s hashing=100kb/s vs rate=100Kb/s downloading=0Kb/s hashing=100kb/s
but it's up to you. feel free to close this ticket if it look/feel not useful.

@AskAlexSharov
Copy link
Collaborator Author

as you can see it's confusing: #13250

@mh0lt mh0lt assigned dvovk and unassigned mh0lt Jan 3, 2025
dvovk added a commit that referenced this issue Jan 7, 2025
Set initial values `prevStats.BytesDownload` and
`prevStats.BytesCompleted` if they are zero, which can occur if the node
was restarted or launched for first time.
Fix for #13250 and
#13044
@dvovk dvovk closed this as completed Jan 16, 2025
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

No branches or pull requests

5 participants