Dragging the slider should not erase the current data.
-
cjmalloy commented at 8:20 PM on February 8, 2016: none
- laanwj added the label GUI on Feb 8, 2016
-
cjmalloy commented at 1:51 AM on February 9, 2016: none
I found the issue: https://github.com/bitcoin/bitcoin/blob/326f010332a68b5b8bbf2ae9c1413d580b1bb9be/src/qt/trafficgraphwidget.cpp#L152
The backing data for the graph is sampled based on the graph range. Any change to the graph range means a different sample size so the previous data is invalid. Could:
- Always use the smallest sample size.
- Change the data to store the current sample size with each sample and draw accordingly.
- Resample the data on range update only if the range increases. If the graph range decreases just clear as we are now. Might not work if the range updates frequently as the slider is being dragged and not on mouse up.
I would think using the smallest sample size is the best idea. Could cache the averaged values when the path is rendered, and then just clear the cache when the graph range is updated.
-
luke-jr commented at 2:03 AM on February 9, 2016: member
Ideally, you'd want to use the smallest sample size, but squash it as it gets older. Eg, save 375ms samples for 5 minutes, and as they age older than 5 minutes, average every pair. This doesn't work with the current scale easily, however, since the next increase after 10 minutes is 15. If approximation is good enough, though, it could start with 5m37.5s, 11m15s, 22m30s, 45m, 1h30m, 3h, 6h, 12h, 1d, etc... (disclaimer: I am biased toward this, since it describes Tonal time units)
-
cjmalloy commented at 3:35 AM on February 9, 2016: none
If we stay with 375ms and compress the data as it is accumulated we would need approx log2(1day / 5 m) = log2(288) = 8.17 times more storing data than the current 800 samples, or 6400 floats. If we store 375ms samples for the whole day we would need 288 times more than the current 800 samples, or 230400 floats.
The first method is tricky because the existing time intervals don't double nicely. The memory savings are 896kB (x2 for in/out), is that enough to worry about?
-
jonasschnelli commented at 4:31 PM on February 19, 2016: contributor
Yes. This is a issue.
IMO, the current sessions network statistics should be stored in the core (CNode) and should be available over RPC (for external statistic tools) and from the GUI. I did some work there (not PRed). The historical network consumption values should be stored without an additional thread. This could be achieved by storing a samples in a list whenever data goes in our out while respecting the min-delta time. This would result in non-lineare samples, so the consuming app (GUI) needs to interpolate the values in between.
Also the statics should include the recent log-per-command feature (https://github.com/bitcoin/bitcoin/pull/6589).
The RAM consumption (sample rate/history size in time) should be configurable and maybe extremely limited for bitcoind by default (non GUI usage).
- laanwj added the label Feature on Apr 28, 2016
-
fanquake commented at 2:52 AM on January 21, 2022: member
- fanquake closed this on Jan 21, 2022
- DrahtBot locked this on Jan 21, 2023