gui
gui copied to clipboard
Scale network graph based on time interval
The Network Graph is updated to scale based on the time interval selected by the QSlider. The graph now displays a sample history that is retained when the QSlider value is changed. Fixes issue #532
This is a short screen cast of the functionality.
https://user-images.githubusercontent.com/152159/151306403-456dee98-ccfa-4db4-90d6-8687936e8180.mov
Here it is retaining 5 1/2 hours of samples - still snappy.
https://user-images.githubusercontent.com/152159/151371047-ac788b14-cb5f-4bc1-b7be-ca662cdc1bdf.mov
Original issue description #7481 (2016)
https://github.com/bitcoin/bitcoin/issues/7481
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviews
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| Concept ACK | jonatack, w0xlt |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #524 (Replace int with std::chrono in for the timer->setInterval() argument by shaavan)
- #492 (Show ToolTip on Network Traffic graph by rebroad)
- #484 (Don't clear traffic graph when changing interval by rebroad)
- #473 (Enable a non-linear network traffic option (click to toggle between linear and non-linear) by rebroad)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Commit https://github.com/bitcoin-core/gui/pull/539/commits/42922129d1d8232fceff271c753e86d5ff555d27 takes the relevant samples from the global sample list to determine tmax - which is used to calculate the y axis'.
https://user-images.githubusercontent.com/152159/151503461-d9682cce-be68-4d12-b4f1-e563077c1338.mp4
Implemented PR #473 Log Scale Toggle
https://user-images.githubusercontent.com/152159/151606196-3981d2df-e0eb-476b-85f6-8fd6c0c07054.mp4
tested it out and seemed to behave as expected.
Concept ACK, thanks for tackling this. Will review/test shortly. Edit: initial testing looks good.
commit 83e521c - attaches the scale toggle to a mouse double click event opposed to a single click event. Toggling the scale is more intentional this way - plus it makes a single click event available for something more useful.
In some of the previous screen shots - the colors look muddy - commit 8eeb1f1 adjusts the visual output to avoid the way the colors were mixing and creating a muddy effect.
https://user-images.githubusercontent.com/152159/151662598-84a5b3ef-8f0b-4c40-91c4-95e3b3012e4e.mp4
I have more ideas related to the network graph - I will post a different PR based on this PR - with some other ideas...

Concept ACK
rebase to fix Centos CI issue 874b2d8 - add hide panel logic which collapses window to a "desktop widget" bb5b4cc - changed DESIRED_SAMPLES to 300 - reducing overall memory usage - going to try some other ideas to minimize memory usage. (interim adjustment based on @rebroad's comment) c0f46d2 - the linear scale is the default presentation - this is familiar to users - a follow up PR should include a note on adding double click log scale to release notes.
commit 874b2d8 screen cast:
https://user-images.githubusercontent.com/152159/152240134-72f51e3b-697c-4065-a752-6108c71b8ac9.mp4
🐙 This pull request conflicts with the target branch and needs rebase.
Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".
I've been working on this, and I have a pull request almost ready to make - storing 600 samples per time range, and 14 ranges in total (from 5 minutes to 28 days), so 8400 samples in total.
https://user-images.githubusercontent.com/1530283/152994292-53a9906c-3a1f-4b84-97ff-036ebb1c60ac.mp4
Or, smoother scaling of the horizontal also, or too gimicky? (below)
https://user-images.githubusercontent.com/1530283/154365362-cb1a688e-4844-4de4-a569-0a27bfab63b3.mp4
The plan is to add notches on the slider for these main samples, but then allow the slider to stop in a few places in between, e.g. for 15m, 45m or 1h30m, 4h30m, 2days, etc.. the resolution will be slightly lower (as it's not sampled at these ranges), but it's probably nice to have these extra options.
@rebroad - awesome!
@rebroad - I am curious if your memory managment is ready...
I am happy to merge it into this PR...
What is the status of this PR?
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
- Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
- Is it no longer relevant? ➡️ Please close.
- Did the author lose interest or time to work on this? ➡️ Please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.
What is the status of this PR?
I'm currently rebasing it. Should update soon.