mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-10-15 10:30:05 +00:00
Fixes #661 (the narrowed scope from the 2026-10-14 comment). ## What changes - `GET /api/observers/metrics/summary` adds `tx_airtime_pct_1h` and `rx_airtime_pct_1h` per observer: the airtime share over the hour before now, whatever `window` is, from the cumulative `tx_air_secs` / `rx_air_secs` counters in `observer_metrics`. - A counter that goes down marks a reboot; only the stretch after the last reset counts. - Under 15 minutes of samples (one sample, or a reboot late in the hour) returns `null`. - Clamped to 0..100, rounded to 2 decimals. - The response also carries `duty_cycle_warn_pct`, from the new config key `dutyCycleWarnPct` (default 10, the EU 868 MHz g3 sub-band limit). Added to `config.example.json`. - RF Health tiles show `TX 1h: x%`; the observer list gets a sortable numeric `TX 1h` column. Both use the shared `public/observer-airtime.js` helper and flag values at or over the threshold with `.airtime-over` (`var(--status-red-text)`). - The handler now returns a named `MetricsSummaryResponse` struct instead of `map[string]interface{}` (one occurrence fewer). ## Why the warning matters Repeater and room-server firmware default to `airtime_factor = 1.0` (`examples/simple_repeater/MyMesh.cpp:890`), which `Dispatcher.cpp:26` turns into a 50% TX budget per 1 h window. The device therefore does not keep itself under the EU 10% limit; this view is where an operator can see it. ## Cost - Server: one extra query per summary request, `SELECT observer_id, timestamp, tx_air_secs, rx_air_secs FROM observer_metrics WHERE timestamp >= now-1h`, on the existing `idx_observer_metrics_timestamp`, then one O(rows) pass. On our instance that is 35 observers x about 12 samples (5 min interval). - Observer list: one extra bulk call `summary?window=1h` per load (client TTL 30 s, failure ignored), not a call per observer. ## Tests - Go: `TestRollingAirtimePct` (steady, reboot mid-hour, single sample, span under 15 min, reboot leaving under 15 min, nil counters, clamp, rounding), `TestGetMetricsSummaryAirtime1h` (samples older than 1 h ignored inside a 24 h window, single-sample observer gets null), `TestMetricsSummaryDutyCycleWarnPct` (default 10, config override, `observers` is `[]` not `null`). Full `cmd/server` suite passes locally (skipping `TestSaveGeoFilterPreservesFileMode`, which fails on Windows on clean master too). - Frontend unit: `tests/unit/test-issue-661-observer-airtime.js` (8 assertions, real file in `vm`), added to `test-all.sh`. `test-observers-headings.js` updated for the new column. Full `test-all.sh` passes locally. - E2E: `tests/e2e/test-issue-661-airtime-e2e.js`, registered in `deploy.yml` and `scripts/non-unit-tests.json`. The fixture DB has no `observer_metrics` table, so the summary is served through `page.route` with known values for the fixture's own observer ids. It checks the column header, over/under/unknown cells, sort order and the RF Health tile. 4/4 locally. It caught a real bug during development: `loadRFHealthData` declares a local `const window`, so the tile calls the helper as the global `ObserverAirtime`. ## Validation Deployed to a staging instance with live MQTT data (35 observers with metrics) and checked in the browser: - The observer list shows the column for 42 rows (33 with a value, 9 without enough samples). Sorting puts the highest share (5.3%) first. - RF Health shows `TX 1h` on all 35 tiles. With a fourth stat the line wrapped inside items on narrow tiles; the stats row now wraps between items only. - No observer was over 10% at the time, so the red state was checked by rendering one cell client-side at 12.5% (computed colour `rgb(185, 28, 28)` in light mode), and by the E2E test. ## Not done - The threshold is config-only; exposing it in the customizer is a follow-up. - No airtime comparison across observers (that is #671) and no per-packet airtime (Relay Airtime Share covers it). - Dark mode was not checked in the browser; `--status-red-text` is defined for both themes. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
140 lines
7.1 KiB
JSON
140 lines
7.1 KiB
JSON
{
|
|
"browser": {
|
|
"reason": "Requires Playwright and Chromium; most suites also require a running local fixture server via BASE_URL. Existing E2E workflow steps retain their separate setup and selection. Never point these tests at production.",
|
|
"files": [
|
|
"tests/e2e/test-1110-live-filter.js",
|
|
"tests/e2e/test-a11y-axe-1668.js",
|
|
"tests/e2e/test-analytics-fluid-charts.js",
|
|
"tests/e2e/test-audio-lab-1297-e2e.js",
|
|
"tests/e2e/test-audio-live-1297-e2e.js",
|
|
"tests/e2e/test-bottom-nav-1061-e2e.js",
|
|
"tests/e2e/test-channel-color-picker-e2e.js",
|
|
"tests/e2e/test-channel-decrypt-e2e.js",
|
|
"tests/e2e/test-channel-fluid-e2e.js",
|
|
"tests/e2e/test-channel-issue-1087-e2e.js",
|
|
"tests/e2e/test-channel-issue-1111-e2e.js",
|
|
"tests/e2e/test-channel-modal-e2e.js",
|
|
"tests/e2e/test-channel-qr-e2e.js",
|
|
"tests/e2e/test-channels-add-modal-e2e.js",
|
|
"tests/e2e/test-channels-list-render-e2e.js",
|
|
"tests/e2e/test-channels-selection-flow-e2e.js",
|
|
"tests/e2e/test-channels-share-color-e2e.js",
|
|
"tests/e2e/test-channels-ws-batch-e2e.js",
|
|
"tests/e2e/test-channels-ws-race-1498-e2e.js",
|
|
"tests/e2e/test-charts-fluid-1058-e2e.js",
|
|
"tests/e2e/test-customize-branding-e2e.js",
|
|
"tests/e2e/test-customize-display-e2e.js",
|
|
"tests/e2e/test-customize-export-e2e.js",
|
|
"tests/e2e/test-customize-theme-e2e.js",
|
|
"tests/e2e/test-drag-manager-e2e.js",
|
|
"tests/e2e/test-e2e-1267-mobile-vcr.js",
|
|
"tests/e2e/test-e2e-playwright.js",
|
|
"tests/e2e/test-filter-ux-e2e.js",
|
|
"tests/e2e/test-gesture-hints-1065-e2e.js",
|
|
"tests/e2e/test-gestures-1062-e2e.js",
|
|
"tests/e2e/test-gestures-1185-scroll-discriminator-e2e.js",
|
|
"tests/e2e/test-home-coverage-e2e.js",
|
|
"tests/e2e/test-issue-1109-hamburger-dropdown-visible-e2e.js",
|
|
"tests/e2e/test-issue-1122-packets-filter-ux-e2e.js",
|
|
"tests/e2e/test-issue-1128-multi-viewport-e2e.js",
|
|
"tests/e2e/test-issue-1128-packets-layout-e2e.js",
|
|
"tests/e2e/test-issue-1136-live-region-e2e.js",
|
|
"tests/e2e/test-issue-1146-path-link-contrast-e2e.js",
|
|
"tests/e2e/test-issue-1147-section-order-e2e.js",
|
|
"tests/e2e/test-issue-1150-404-state-e2e.js",
|
|
"tests/e2e/test-issue-1151-orphan-separators-e2e.js",
|
|
"tests/e2e/test-issue-1204-live-panel-structure-e2e.js",
|
|
"tests/e2e/test-issue-1205-live-controls-anchor-e2e.js",
|
|
"tests/e2e/test-issue-1206-resize-observer-leak-e2e.js",
|
|
"tests/e2e/test-issue-1206-vcr-overlap-e2e.js",
|
|
"tests/e2e/test-issue-1224-channels-mobile-ux-e2e.js",
|
|
"tests/e2e/test-issue-1234-live-chrome-pass2-e2e.js",
|
|
"tests/e2e/test-issue-1236-map-mobile-e2e.js",
|
|
"tests/e2e/test-issue-1244-live-vcr-row-hints-e2e.js",
|
|
"tests/e2e/test-issue-1273-qr-overlay-height-e2e.js",
|
|
"tests/e2e/test-issue-1274-legend-coverage-e2e.js",
|
|
"tests/e2e/test-issue-1279-legend-p2-e2e.js",
|
|
"tests/e2e/test-issue-1281-location-row-e2e.js",
|
|
"tests/e2e/test-issue-1306-collisions-terminology-e2e.js",
|
|
"tests/e2e/test-issue-1329-map-controls-accordion-e2e.js",
|
|
"tests/e2e/test-issue-1367-channels-chat-app-e2e.js",
|
|
"tests/e2e/test-issue-1374-route-map-a11y-e2e.js",
|
|
"tests/e2e/test-issue-1400-nav-vertical-clip.js",
|
|
"tests/e2e/test-issue-1413-nav-overlap-e2e.js",
|
|
"tests/e2e/test-issue-1486-collapse-reopens-detail-e2e.js",
|
|
"tests/e2e/test-issue-1487-byop-modal-layout-e2e.js",
|
|
"tests/e2e/test-issue-1510-live-nav-pin-e2e.js",
|
|
"tests/e2e/test-issue-1567-corner-clears-drag-e2e.js",
|
|
"tests/e2e/test-issue-1599-replay-freeze-e2e.js",
|
|
"tests/e2e/test-issue-1630-reach-mobile-e2e.js",
|
|
"tests/e2e/test-issue-1639-observers-sort-e2e.js",
|
|
"tests/e2e/test-issue-661-airtime-e2e.js",
|
|
"tests/e2e/test-issue-1640-compare-discovery-e2e.js",
|
|
"tests/e2e/test-issue-1648-m1-icons-e2e.js",
|
|
"tests/e2e/test-issue-1648-m2-icons-e2e.js",
|
|
"tests/e2e/test-issue-1648-m3-icons-e2e.js",
|
|
"tests/e2e/test-issue-1648-m4-icons-e2e.js",
|
|
"tests/e2e/test-issue-1648-m5-icons-e2e.js",
|
|
"tests/e2e/test-issue-1657-analytics-channels-group-sprites-e2e.js",
|
|
"tests/e2e/test-issue-1692-packets-init-parallel-e2e.js",
|
|
"tests/e2e/test-issue-1705-subpath-contrast-e2e.js",
|
|
"tests/e2e/test-issue-1758-ng-filter-rerenders-e2e.js",
|
|
"tests/e2e/test-issue-1799-label-vocab-e2e.js",
|
|
"tests/e2e/test-issue-1833-legend-toggle-clickable-e2e.js",
|
|
"tests/e2e/test-issue-1997-distance-building-e2e.js",
|
|
"tests/e2e/test-live-dedup.js",
|
|
"tests/e2e/test-live-fullscreen-1572-e2e.js",
|
|
"tests/e2e/test-live-layout-1178-1179-e2e.js",
|
|
"tests/e2e/test-live-mql-leak-1180-e2e.js",
|
|
"tests/e2e/test-live-multibyte-only-e2e.js",
|
|
"tests/e2e/test-logo-default-sage-teal-e2e.js",
|
|
"tests/e2e/test-logo-pulse-1173-e2e.js",
|
|
"tests/e2e/test-logo-rebrand-e2e.js",
|
|
"tests/e2e/test-logo-theme-e2e.js",
|
|
"tests/e2e/test-map-modal-fluid-e2e.js",
|
|
"tests/e2e/test-map-nodes-pagination-e2e.js",
|
|
"tests/e2e/test-nav-drawer-1064-e2e.js",
|
|
"tests/e2e/test-nav-fluid-1055-e2e.js",
|
|
"tests/e2e/test-nav-more-floor-1139-e2e.js",
|
|
"tests/e2e/test-nav-priority-1102-e2e.js",
|
|
"tests/e2e/test-nav-priority-1311-e2e.js",
|
|
"tests/e2e/test-nav-priority-1391-e2e.js",
|
|
"tests/e2e/test-neighbor-map-btn-clip-e2e.js",
|
|
"tests/e2e/test-node-reach-coverage-e2e.js",
|
|
"tests/e2e/test-node-reach-e2e.js",
|
|
"tests/e2e/test-nodes-export-e2e.js",
|
|
"tests/e2e/test-observer-iata-1188-e2e.js",
|
|
"tests/e2e/test-packets-compact-columns-e2e.js",
|
|
"tests/e2e/test-packets-scope-column.js",
|
|
"tests/e2e/test-path-inspector-coverage-e2e.js",
|
|
"tests/e2e/test-rx-coverage-mobile-nav-e2e.js",
|
|
"tests/e2e/test-rx-coverage-gaps-e2e.js",
|
|
"tests/e2e/test-rx-coverage-noise-e2e.js",
|
|
"tests/e2e/test-rx-coverage-viewport-e2e.js",
|
|
"tests/e2e/test-show-neighbors.js",
|
|
"tests/e2e/test-slideover-1056-e2e.js",
|
|
"tests/e2e/test-slideover-1168-munger-e2e.js",
|
|
"tests/e2e/test-table-fluid-e2e.js",
|
|
"tests/e2e/test-touch-gestures-coverage-e2e.js",
|
|
"tests/e2e/test-touch-targets.js",
|
|
"tests/e2e/test-user-management-e2e.js"
|
|
]
|
|
},
|
|
"domIntegration": {
|
|
"reason": "Requires jsdom. The JS unit gate runs with no node_modules at all (its job has no npm install), so a suite needing a third-party module cannot live in test-all.sh. It runs in the E2E job, which does npm ci, and is invoked by its own deploy.yml line.",
|
|
"files": [
|
|
"tests/e2e/test-region-quick-picks.js",
|
|
"tests/e2e/test-table-sort.js"
|
|
]
|
|
},
|
|
"playwrightRunner": {
|
|
"reason": "Requires the @playwright/test runner (not plain node), its configuration, Chromium, and a local server. @playwright/test is not currently declared in package.json; these suites are inventoried but not part of the standalone unit gate.",
|
|
"files": [
|
|
"tests/e2e/test-issue-1522-trace-url-sync-e2e.js",
|
|
"tests/e2e/test-marker-outline-weight.js",
|
|
"tests/e2e/test-path-inspector-e2e.js",
|
|
"tests/e2e/test-pr-1490-live-map-gpu-animations-e2e.js"
|
|
]
|
|
}
|
|
}
|