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

Download speed info in (*File) itself #731

Open
glblduh opened this issue Mar 22, 2022 · 4 comments
Open

Download speed info in (*File) itself #731

glblduh opened this issue Mar 22, 2022 · 4 comments

Comments

@glblduh
Copy link

glblduh commented Mar 22, 2022

Can this feature be added to remove the need to calculate the speed in the application itself. This will be beneficial for many torrents because it removes the need to calculate for the download speed in each file in each torrents.

@anacrolix
Copy link
Owner

How do you currently do it? You could collect the piece states for all pieces that are in a file and calculate their byte contributions and sum them up? Does that sound right?

@glblduh
Copy link
Author

glblduh commented May 12, 2022

It can be the for the entire torrent. Like a method of the Torrent struct that outputs the current calculated download speed.

I currently do it with a concurrent function that infinitely iterates through all of the torrents to calculate its download and upload speed.

@anacrolix
Copy link
Owner

Ah yeah I mean how are you calculating speeds per File? I would prefer not to encode speed into the client itself, it should be relatively straight forward to calculate from the piece states and bytes per piece for each file, and calculating the difference since the last calculation for each File (or Torrent etc.). I would be okay with putting some helpers for doing it somewhere in the module.

@glblduh
Copy link
Author

glblduh commented May 13, 2022

I think the completed bytes of each file can be used for calculation, but I haven't tried it.

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

2 participants