gui icon indicating copy to clipboard operation
gui copied to clipboard

Scale network graph based on time interval

Open RandyMcMillan opened this issue 3 years ago • 18 comments

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

RandyMcMillan avatar Jan 27 '22 06:01 RandyMcMillan

This is a short screen cast of the functionality.

https://user-images.githubusercontent.com/152159/151306403-456dee98-ccfa-4db4-90d6-8687936e8180.mov

RandyMcMillan avatar Jan 27 '22 06:01 RandyMcMillan

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

RandyMcMillan avatar Jan 27 '22 13:01 RandyMcMillan

Original issue description #7481 (2016)

https://github.com/bitcoin/bitcoin/issues/7481

RandyMcMillan avatar Jan 27 '22 14:01 RandyMcMillan

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.

DrahtBot avatar Jan 27 '22 21:01 DrahtBot

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

RandyMcMillan avatar Jan 28 '22 07:01 RandyMcMillan

Implemented PR #473 Log Scale Toggle

https://user-images.githubusercontent.com/152159/151606196-3981d2df-e0eb-476b-85f6-8fd6c0c07054.mp4

RandyMcMillan avatar Jan 28 '22 19:01 RandyMcMillan

tested it out and seemed to behave as expected.

rsafier avatar Jan 29 '22 00:01 rsafier

Concept ACK, thanks for tackling this. Will review/test shortly. Edit: initial testing looks good.

jonatack avatar Jan 29 '22 00:01 jonatack

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.

RandyMcMillan avatar Jan 29 '22 09:01 RandyMcMillan

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

RandyMcMillan avatar Jan 29 '22 13:01 RandyMcMillan

I have more ideas related to the network graph - I will post a different PR based on this PR - with some other ideas...

Screen Shot 2022-01-29 at 2 10 01 PM (2)

RandyMcMillan avatar Jan 29 '22 19:01 RandyMcMillan

Concept ACK

w0xlt avatar Jan 30 '22 15:01 w0xlt

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

RandyMcMillan avatar Feb 02 '22 21:02 RandyMcMillan

🐙 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".

DrahtBot avatar Feb 04 '22 11:02 DrahtBot

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 avatar Feb 07 '22 19:02 rebroad

@rebroad - awesome!

RandyMcMillan avatar Feb 07 '22 20:02 RandyMcMillan

@rebroad - I am curious if your memory managment is ready...

I am happy to merge it into this PR...

RandyMcMillan avatar Apr 04 '22 03:04 RandyMcMillan

What is the status of this PR?

hebasto avatar Jul 19 '22 13:07 hebasto

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.

DrahtBot avatar Oct 31 '22 10:10 DrahtBot

What is the status of this PR?

I'm currently rebasing it. Should update soon.

rebroad avatar Dec 10 '22 20:12 rebroad