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

Incorrect Traffic Period Sorting #2818

Open
4 tasks done
solonovamax opened this issue Dec 6, 2024 · 4 comments
Open
4 tasks done

Incorrect Traffic Period Sorting #2818

solonovamax opened this issue Dec 6, 2024 · 4 comments
Labels

Comments

@solonovamax
Copy link

Please complete the following tasks.

  • Web browser cache cleared
  • Link provided to install script if applicable
  • Not using broken rtinst install script
  • Web browser, ruTorrent, PHP and OS version provided

Tell us about your environment

Web Browser: Firefox 134.0b2
ruTorrent: v5.1.1
PHP: 8.3.14
OS: Arch Linux 6.11.9-arch1-1 x86_64

Tell us how you installed ruTorrent

via the rutorrent AUR package (the package is currently out of date, so I changed the version from 5.0.0 to 5.1.1 manually then set the sha256 for it to 'SKIP')

Describe the bug

The sorting of dates is incorrect.

The dates (in the provided screenshot) are sorted in the following order:

  • 01.2024
  • 02.2024
  • [empty slot]
  • 04.2023
  • 05.2024
  • 06.2024
  • 07.2024
  • 08.2024
  • [09 not present ??]
  • 10.2023
  • 11.2023
  • 12.2023

image

How it manages to sort like this is entirely beyond me, unless it's some type of race condition

Steps to reproduce

  1. Enable trafic [sic] plugin
  2. Run rutorrent for at least a year (or create data that goes back a year)
  3. Open "Traffic" tab
  4. Observe incorrect sorting

Expected behavior

Does not do this.

Additional context

No response

@stickz
Copy link
Collaborator

stickz commented Dec 7, 2024

Does this bug date back to version 4? Or does it only happen on version 5?

@stickz stickz added the bug label Dec 7, 2024
@solonovamax
Copy link
Author

not sure

I don't have time to test rn, but remind me in ~1 week (if I forgot to do it before then) and I'll test it

@ACiDxCHRiST
Copy link

ACiDxCHRiST commented Dec 9, 2024

There are some irregularities in the diagnostics you provided, but can you clarify exactly what you don't like. It looks to me to be mostly functioning as intended.

January will always be the first bar on the left and December will always be the last bar on the right. The orientation of the months will never shift. Notice that the individual bars are two different shades of green, one brighter and one darker (the same is true for download which is blue, but downloaded amount is not significant in relation to uploaded amount in your case and so does not appear prominently in your image). Data for the current year is the brighter green, whereas data from the prior year will be the darker green. The only time all the bars will be bright green, will be during the month of December when all currently displayed data is from the current year.

Now for the irregularities in your image, I think they can mostly be explained by missing or corrupt data in the stored traffic information. I am assuming that there is no data for 03.2023 or 03.2024 which is why that bar is completely missing including its label. There is no data for 04.2024, which is why the data from 04.2023 is being displayed which would not be the case if there was 04.2024 data in the database. As for why 08.2023 data is being displayed in the 9th position (or at least that's what the label says), is the only thing that I have no explanation for and would consider not working as intended. It would be a reasonable assumption that, if there IS corruption in some of the stored traffic data, that that could have somehow confused the graph renderer and led it to display some of the information in the wrong place.

Screenshot 2024-12-09 162224

Here is another screenshot of traffic for additional reference. Unfortunately since we are in the month of December, none of the data in this graph is from the prior year and therefore, none of the bars are the darker green color.

Also, I cant help with this, but for anyone to determine whether your issue is a bug in ruTorrent, or just your installation working with incomplete/corrupt data, they would need a copy of all your stored traffic data. /var/www/ruTorrent\share\users\[USERNAME]\settings\trafic to be able to possibly see why the Traffic plugin is displaying your data the way that it is.

Additionally, please read https://github.com/Novik/ruTorrent/wiki/PluginTrafic which has some documentation on how the plugin works. Pay specific attention to this point:

How does it work

When ruTorrent is loaded for the first time (with the trafic plugin) it sends a command to the rtorrent scheduler, which begins to provide the application with information about it's current traffic statistics. (Once again, it's important to understand that traffic statistics do not begin registering until he first load of the plugin. If rtorrent is running, but ruTorrent hasn't been loaded, the Trafic Plugin is not keeping track) To avoid this issue, we can use the initplugins.php method to load all plugins at rtorrent start (see How to start plugins with rtorrent).

Some non-obvious points

  • The time ticks shown on the chart correspond to the server's time settings. If time settings on the client differ from those of > the server, this plugin may not function as intended. If this happens, the recommended solution is to sync both client and server with the correct time zone information and clear the traffic statistics.
  • Clicking "Clear" while "All Trackers" is selected will erase all Traffic stats. Clicking "Clear" when a specific tracker is selected will only erase Traffic data for that tracker.
  • Traffic is counted for all trackers in the zeroth group of every torrent. All other groups will be ignored.
  • Traffic data on the charts may not match up with the tracker's internal statistics because the plugin can only keep track of data provided by rtorrent. It doesn't know what information has been sent to the tracker.

Finally, to emphasize the above if it isn't apparent, until you load the ruTorrent webpage in your browser and login, after bringing up rtorrent, the Traffic plugin is not recording data (unless you have added the correct command to your .rtorrent.rc file.)

@solonovamax
Copy link
Author

There are some irregularities in the diagnostics you provided, but can you clarify exactly what you don't like. It looks to me to be mostly functioning as intended.

what irregularities in the diagnostics?

Now for the irregularities in your image, I think they can mostly be explained by missing or corrupt data in the stored traffic information. I am assuming that there is no data for 03.2023 or 03.2024 which is why that bar is completely missing including its label. There is no data for 04.2024, which is why the data from 04.2023 is being displayed which would not be the case if there was 04.2024 data in the database. As for why 08.2023 data is being displayed in the 9th position (or at least that's what the label says), is the only thing that I have no explanation for and would consider not working as intended. It would be a reasonable assumption that, if there IS corruption in some of the stored traffic data, that that could have somehow confused the graph renderer and led it to display some of the information in the wrong place.

[...]

Also, I cant help with this, but for anyone to determine whether your issue is a bug in ruTorrent, or just your installation working with incomplete/corrupt data, they would need a copy of all your stored traffic data. /var/www/ruTorrent\share\users\[USERNAME]\settings\trafic to be able to possibly see why the Traffic plugin is displaying your data the way that it is.

I'll provide a tarball of all of my traffic data later.

Additionally, please read https://github.com/Novik/ruTorrent/wiki/PluginTrafic which has some documentation on how the plugin works. Pay specific attention to this point:

How does it work

When ruTorrent is loaded for the first time (with the trafic plugin) it sends a command to the rtorrent scheduler, which begins to provide the application with information about it's current traffic statistics. (Once again, it's important to understand that traffic statistics do not begin registering until he first load of the plugin. If rtorrent is running, but ruTorrent hasn't been loaded, the Trafic Plugin is not keeping track) To avoid this issue, we can use the initplugins.php method to load all plugins at rtorrent start (see How to start plugins with rtorrent).

hmm, this is good to know. I was not aware of this.
might be desireable to mention it somewhere more noticeable? dunno.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants