Commit c238cef
committed
Merge #805: Avoid hidden network traffic graph updates
35fecc9 qml: avoid shadowing LineGraph fillColor (johnny9)
5f00942 qml: avoid hidden network traffic updates (johnny9)
Pull request description:
## What changed
- move network traffic sampling, smoothing, and history retention onto an owned worker thread
- publish immutable traffic snapshots back to the GUI thread only while the Network Traffic page is active
- retain raw samples while hidden and rebuild the requested range when the page becomes active again
- lazy-load the Network Traffic settings page so its graphs do not exist while another settings section is selected
- preserve byte totals as 64-bit values
- rename the native graph gradient property so it no longer shadows `QQuickPaintedItem::fillColor`
- add C++ and QML coverage for thread affinity, hidden-page suppression, retained history, range changes, page lifecycle, and destruction while active
## Why
The previous timer was moved to a background thread, but its timeout updated a GUI-thread model every second regardless of whether the Network Traffic page was visible. That kept smoothing, full-history copies, signal delivery, and graph bindings active in the background. Timer/thread ownership was also not explicit during shutdown.
This keeps the inexpensive raw sample collection running off-thread while avoiding hidden GUI work and making worker shutdown deterministic.
`LineGraph` also declared its own `fillColor` property over the property inherited from `QQuickPaintedItem`, producing a QML property-cache warning. The native property is now named `gradientColor`; the public `NetworkTrafficGraph.fillColor` API and rendering behavior are unchanged.
## User impact
Opening Network Traffic still shows the samples collected while the page was hidden, and changing the graph range rebuilds the visible history without losing totals. Other settings pages no longer pay for traffic graph updates or retain the graph objects.
## Issue
Fixes #611.
Fixes #801.
Graph reset behavior was split from #611 into #806 and is intentionally not included here.
## Validation
- full RelWithDebInfo build with app tests enabled
- `qmllint -I qml -I test/mocks/qml qml/components/NetworkTrafficGraph.qml qml/pages/node/NetworkTraffic.qml qml/pages/node/NodeSettings.qml test/qml/tst_nodesettings.qml`
- `bitcoinqml_qmltests`: 380 passed, 0 failed
- `NetworkTrafficTowerTests`: 6 passed, 0 failed
- `git diff --check origin/qt6...HEAD`
The aggregate unit executable was also run locally. Its Network Traffic suite passed; unrelated existing OptionsModel tests could not write the default Bitcoin data directory inside the managed filesystem sandbox.
ACKs for top commit:
jarolrod:
ACK 35fecc9
Tree-SHA512: 765de9435d4b73942bd4f85bfdfe082b1ad360c950c853fd6aa14c6d8bc6f011f2ffad3d0b7cb361dd40d701a63bfe9a4ca47bd4cf107017cc6f7b9741b730de12 files changed
Lines changed: 565 additions & 138 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
595 | | - | |
| 595 | + | |
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
0 commit comments