-
Notifications
You must be signed in to change notification settings - Fork 313
Scale network graph based on time interval #539
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
Scale network graph based on time interval #539
Conversation
This is a short screen cast of the functionality. Screen.Recording.2022-01-27.at.1.47.21.AM.mov |
Here it is retaining 5 1/2 hours of samples - still snappy. Screen.Recording.2022-01-27.at.8.42.34.AM.mov |
Original issue description #7481 (2016) |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
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 4292212 20220128021252941.mp4 |
86120e9
to
fba8ef0
Compare
Implemented PR #473 Log Scale Toggle 20220128140238975.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. |
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. commit-8eeb1f1.mp4 |
Concept ACK |
void TrafficGraphWidget::paintEvent(QPaintEvent *) | ||
{ | ||
QPainter painter(this); | ||
painter.fillRect(rect(), Qt::black); | ||
|
||
if(fMax <= 0.0f) return; | ||
|
||
QColor axisCol(Qt::gray); | ||
QColor axisCol(QColor(78,78,78,255)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't check to see if there was a Qt defined dark gray - It is ideal to let the samples stand out above the scale lines - we can tweak this. Note: there is plenty of room unused in the side panel - I have some code laying around to define user preferred color palettes - could be a useful feature for usability/accessibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A thought was to implement Solarized Light/Dark color palettes as user options - I am a fan - and plenty of research has gone into these color schemes.
@@ -135,32 +161,35 @@ void TrafficGraphWidget::updateRates() | |||
nLastBytesIn = bytesIn; | |||
nLastBytesOut = bytesOut; | |||
|
|||
while(vSamplesIn.size() > DESIRED_SAMPLES) { | |||
while(vSamplesIn.size() > FLT_MAX - 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how much memory does this need?
concept ACK implementation NACK - it's unnecessary to store so many sample points, given the granulatory can be decreased as the times period gets longer. Resampling as the data gets older is a better way (as it avoids wasting memory on data that will never be displayed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree - I have been thinking about how to do this. Maybe pruning the list at larger intervals - keeping samples that are above a moving average. Open to suggestions on implementation. :)
Thanks for looking at this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can chunk the end of the list at DESIRED_SAMPLES intervals - calculate the moving average - pruning samples that fall below it.
The debugwindow - network graph hides ui elements btnClearTrafficGraph, lblGraphRange, sldGraphRange when at minimumHeight, it also hides the groupBox at minimumWidth - this maximizes the dimensions of the traffic graph in these small dimensions.
0902db8
to
874b2d8
Compare
rebase to fix Centos CI issue commit 874b2d8 screen cast: 20220202160130623_trimmed.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. video_2022-02-08_13-12-48.mp4Or, smoother scaling of the horizontal also, or too gimicky? (below) video_2022-02-16_22-05-15.mp4The 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?
|
I'm currently rebasing it. Should update soon. |
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
Done. |
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