Commit 48d10b4
authored
feat: Connection Monitor - always-on latency monitoring (#195)
* docs: add Connection Monitor design spec and implementation plan
Design spec for issue #194 - native always-on latency monitor.
MVP scope agreed with external review: 5s default polling, no
aggregation tables in V1, minimal event set, TCP-first UX framing.
Implementation plan covers 14 tasks across 5 chunks:
scaffold, storage, probe engine, events, collector, routes,
Docker CAP_NET_RAW, i18n, settings, card, detail view, testing.
* feat(connection-monitor): add module scaffold with manifest
* feat(connection-monitor): add probe engine with ICMP/TCP auto-detection
* feat(connection-monitor): add storage layer for targets and samples
* feat(connection-monitor): add event rules for outage detection and recovery
* feat(connection-monitor): add collector with parallel probing and event integration
* feat(connection-monitor): add API routes for targets, samples, outages, export, capability
* feat(connection-monitor): add NET_RAW capability for ICMP probing
* feat(connection-monitor): add i18n translations (EN/DE/FR/ES)
* feat(connection-monitor): add settings page template
* feat(connection-monitor): add dashboard summary card
* feat(connection-monitor): add detail view with latency, loss, availability charts
* fix: move Connection Monitor from Extensions to core analysis nav
* fix: use clean view ID 'connection-monitor' instead of module prefix
* fix(connection-monitor): allow creating targets without host for add-then-edit UX
* feat(connection-monitor): add demo data with evening congestion + outage scenario
* feat(connection-monitor): rewrite charts to PingPlotter style
- Combined all targets into single uPlot chart with overlaid series
- Added threshold zones (green <30ms, yellow 30-100ms, red >100ms)
- Added red vertical loss markers via custom uPlot draw hook plugin
- Removed target tab switching, fetch all targets in parallel
- Combined outage log across all targets with target name column
- Added per-target CSV export links
- Extended chart-engine.js renderChart() to accept custom plugins via opts
- Added cm_outage_target i18n key to all 4 languages
* fix(connection-monitor): use correct duration_seconds field in outage log
The API returns duration_seconds but the JS code referenced duration_s,
causing all outage durations to show as dashes instead of actual values.
* feat(connection-monitor): group overlapping outages across targets
Outages with start times within 60s are merged into a single row
showing all affected targets (e.g. "Cloudflare DNS, Google DNS").
Reduces log spam when an ISP outage affects multiple targets.
* feat(connection-monitor): add stats cards, zoom, improved CSV export, UX fixes
- Stats cards: Avg/Min/Max/P95 latency, packet loss %, sample count
- Chart zoom: drag-to-select zoom via uPlot plugin, double-click reset
- X-axis: show date+time for ranges >24h instead of just time
- CSV export: human-readable timestamps, target label in filename
- TCP mode badge with glossary popover explaining ICMP vs TCP
- Outage table: fixed column widths, duration right-aligned
- Export: use <a download> for reliable file download
* feat(connection-monitor): add per-target stats, fix chart zoom, fault diagnosis
- Per-target stats table comparing Gateway vs external targets
- Automatic fault diagnosis (external vs internal/ISP issue)
- Fix chart zoom: zoomable option in chart-engine with auto:false
prevents uPlot's auto-ranging from overriding setScale
- Zoom plugin: drag-to-select + double-click reset via _zoomRange
- i18n: add per-target and diagnosis keys (EN/DE/FR/ES)
* fix(connection-monitor): add Cache-Control no-store to API responses
Prevents browser from caching API responses with stale target IDs
across container rebuilds.
* fix(connection-monitor): move dashboard card above donut charts
Place Connection Monitor card between BNetzA and channel health
donuts instead of below them in the generic module cards section.
* fix: unify dashboard card grid - BNetzA and CM same size as metric cards
Move BNetzA and Connection Monitor cards into the main metrics-grid
so all cards have consistent sizing. Previously BNetzA was full-width
and CM was in a separate section below the donut charts.
* fix(connection-monitor): address code review findings
- Add @require_auth to all read/export endpoints (consistent with other modules)
- Fix capability endpoint to detect actual probe method instead of hardcoding TCP
- Disable new targets with empty host to prevent false timeouts
- Remove 10k sample limit in detail view to avoid truncating 24h/7d data
- Include connection_monitor.db in backup/restore with VACUUM INTO consistency
* fix(connection-monitor): auto-enable target on host update, use configured probe method
- Auto-set enabled=True when a non-empty host is provided via PUT (fixes
blank-host regression where new targets stayed disabled after host entry)
- Read configured probe method from config for capability endpoint instead
of always using auto-detection (badge now reflects user's explicit setting)
* fix(connection-monitor): wire up packet loss warnings, use configured outage threshold
- Call check_window_stats() in collector after probe checks to emit
cm_packet_loss_warning events when loss exceeds configured threshold
- Read outage threshold from config in outages API instead of hardcoding 5,
so the outage table and collector events agree on the threshold value
* test(connection-monitor): fix CI failure, add auth and add-target flow tests
- Set DATA_DIR to tmp_path in collector tests to avoid /data permission
error on CI runners
- Add auth enforcement tests verifying all endpoints return 401 when
admin_password is configured but no session is provided
- Add add-target flow tests: disabled without host, enabled with host,
auto-enable on host update via PUT
* fix: change BQM icon to chart-spline, reorder sidebar navigation
- Change BQM Graphs icon from 'activity' to 'chart-spline' to
distinguish from Connection Monitor which also uses 'activity'
- Reorder monitoring sidebar: Home, Event Log, Correlation, Signal
Trends, Channels, Connection Monitor, Segment Util, Before/After,
Gaming Quality Index, Modulation
---------
Co-authored-by: itsDNNS <itsDNNS@users.noreply.github.com>1 parent 5900fac commit 48d10b4
File tree
33 files changed
+5693
-53
lines changed- app
- collectors
- modules
- backup
- bqm
- connection_monitor
- i18n
- static/js
- templates
- static/js
- templates
- docs/superpowers
- plans
- specs
- tests/modules
- connection_monitor
33 files changed
+5693
-53
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| |||
888 | 889 | | |
889 | 890 | | |
890 | 891 | | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
891 | 993 | | |
892 | 994 | | |
893 | 995 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
57 | | - | |
58 | | - | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
60 | | - | |
| 63 | + | |
61 | 64 | | |
62 | | - | |
| 65 | + | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| |||
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
| 96 | + | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | | - | |
95 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
96 | 105 | | |
| 106 | + | |
97 | 107 | | |
98 | 108 | | |
99 | 109 | | |
100 | 110 | | |
101 | 111 | | |
102 | | - | |
| 112 | + | |
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
106 | 116 | | |
107 | 117 | | |
108 | 118 | | |
109 | 119 | | |
110 | | - | |
111 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
112 | 123 | | |
113 | | - | |
| 124 | + | |
114 | 125 | | |
115 | 126 | | |
116 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
Whitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
0 commit comments