Repository navigation
Port upstream 2208: 1 h TX airtime + duty-cycle warning - #481
Merged
Merged
Conversation
Relates to #479. Adds tx/rx_airtime_pct_1h to the observer metrics summary (reboot-aware, 30 min minimum span, 15 min staleness, clamped, 2 decimals), duty_cycle_warn_pct from the new dutyCycleWarnPct config key (default 10), a sortable TX 1h column in the observer list and a TX 1h stat on the RF Health tiles. The per-sample TX/RX values in the RF detail panel are now labelled "/sample". Summary response is a named struct. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Relates to #479. The earlier edit to .eslintrc.json did not apply, so the no-undef lint job failed on analytics.js. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Owner
Author
Rapport — CS-Minimax PR#481 #479 — head 968bfe1Status: Draft PR ready for review; all CI jobs green on the final head (one unrelated flaky Go test failed on the first run). Evidence: [T] test or CI result, [A] browser/manual check, [K] code/source reading. Requirements
Browser check
Invariants
CI (final head, per job)Go Build & Test, Go Ingestor, Go Libraries & CLI, Go Server 1/3, 2/3, 3/3, Script & Container Checks, JS Unit & Lint, Playwright 1/3, 2/3, 3/3, Verify E2E Shards, Verify Go Test Assignments, Validate Docker Image: all pass. Residuals
|
dborup
marked this pull request as ready for review
October 15, 2026 21:00
This was referenced Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to #479
Evaluated port of upstream PR 2208 (merged head
c6685c61, upstream issue 661), adapted to this fork's layout (root-leveltest-*.js, existingGetMetricsSummary, existing per-sampletx_airtime_pct).Plan / what changes
cmd/server, read-only, no new writes)rollingAirtimePct: share over the last hour from the cumulativetx_air_secs/rx_air_secscounters. A falling counter marks a reboot and only the stretch after the last reset counts.nullwhen that span is under 30 min or the newest sample is older than 15 min. Clamped to 0..100, rounded to 2 decimals.GetMetricsSummary(since, now)addstx_airtime_pct_1h/rx_airtime_pct_1hper row via one extra bulk query on the existing timestamp index, independent ofwindow.duty_cycle_warn_pctfrom new config keydutyCycleWarnPct(default 10, inconfig.example.json).MetricsSummaryResponse(the handler'smap[string]interface{}is removed; no new ones). OpenAPI description updated.public/observer-airtime.js(one shared helper:format,isOver,badge).isOvercompares at the displayed one decimal, so "10.0%" is always flagged.TX 1hcolumn; one bulk summary call with a 30 s client TTL, not one per observer.TX 1hstat. Warning style isvar(--danger), no hardcoded colours.TX/sample/RX/sample;TX 1halways means the rolling hour.Tests (written first)
TestRollingAirtimePct(steady state, reboot mid-hour, single sample, no samples, span under/at 30 min, reboot leaving under 30 min, stale newest sample at 15 min, nil counters, clamping, rounding),TestGetMetricsSummaryAirtime1h(integration, incl. silent observer),TestMetricsSummaryDutyCycleWarnPct.test-issue-479-observer-airtime.js(helper),test-issue-479-airtime-e2e.js(column, warning, sort both ways, both themes, 360x800),test-observers-headings.jsandtest-xss-escape-sinks.jsupdated.test-all.shandscripts/e2e-shards.json.Perf
One extra query per summary request, bounded by one hour of samples (about 12 rows per observer), grouped in memory per observer. The observer list adds one bulk call, cached 30 s.
Follow-up (AGENTS.md rule 8)
dutyCycleWarnPctshould be exposed in the customizer later; not built here.No workflow files touched.
🤖 Generated with Claude Code