Repository navigation
π dashboard: cap histories, dedupe intervals, cancel animations to stop tab memory growth - #10568
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Changelog: this PR changes code but carries no changelog entry If it is user-visible β a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
dc61453 to
4c7ea85
Compare
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
42e2f0e to
646c51f
Compare
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
c47e3a1 to
7dec7dd
Compare
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
e8d4f0b to
37d43b3
Compare
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
f2c2ced to
901f094
Compare
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
There was a problem hiding this comment.
One verified behaviour change that the body does not mention; everything else I traced looks correct.
Repo/governor trend sparklines shrink from ~7 days to ~30 hours. src/pkg/dashboard/static/index.html (PR head):
- :7669-7671 sets
SPARKLINE_MAX_POINTS = 360and aliasesCLIENT_HISTORY_MAX_SAMPLESto it. The constant it replaces was2016, with the deleted comment stating the reason: "one week at the server's 5-min trend resolution". mergeTrendHistory(:8057-8099) folds/api/trend/historyintohistoryDataand then caps it atDASHBOARD_HISTORY_CAP(:8096). The server keeps up totrendHistoryMaxEntries = 8640five-minute samples (src/pkg/dashboard/server.go:1086-1088), so after the merge only the newest 360 survive β 30 hours.- Those are the points the repository-card and governor sparklines draw:
sparkSvg(historyData.map(s => s.repos?.[r.name]?.issues β¦))at :13225-13226, and the agentStats/token sparklines at :8790, :15132, :15198 read the same array.
Consequence: a tab that previously showed a week of issue/PR trend on each project card now shows a little over a day, and the persisted hive_sparkline_history in localStorage is truncated to 360 on the next persistSparklineHistory() (:7704), so the older points are gone for good on that browser. The memory saved is ~1.6k small objects per tab, which the "before" measurement in the body (4.3 MB heap at t20) suggests was not the growth source. If the shorter window is intended, it deserves a line in the changelog fragment; if not, keeping CLIENT_HISTORY_MAX_SAMPLES at 2016 (or decoupling it from SPARKLINE_MAX_POINTS) preserves the range while the rest of the PR still lands.
Minor, no action needed: :8097 capHistory(historyData) is a no-op now that capHistory returns a copy instead of splicing β the assignment on :8096 already did the work. All other capHistory callers (:7700, :7704, :8682) assign the return value, so the spliceβslice change is safe.
Checked and fine: dashboardSetInterval clears before re-arming; cancelSparklineWork cancels both the stagger Set and the per-wrapper cleanup timers before innerHTML replacement; the KPI RAF path cancels the prior frame per node and bails on disconnected nodes.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
|
Shared CI incident: the π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Closes #10557
Summary
Measurement
Harness: local fixture-backed static dashboard served from
src/pkg/dashboard/static/index.html, headless Chrome via puppeteer-core in~/hc-wt-mem/.scratch, timers accelerated to 500ms after warmup; each row is an accelerated minute sample with forced GC and CDP heap usage. Heap snapshots scanned forDetached,HTML*Element,SVG*Element, andArrayconstructor strings.The after run stayed within +8.4% heap growth over the accelerated t0βt20 window, with stable detached-node and DOM counts.
Static audit
setInterval(sites at baseline. Recurring dashboard pollers now route throughdashboardSetInterval; modal/countdown/carousel/auth-flow timers remain locally cleared/whitelisted with reasons in the guard test.Validation
gofmt -l src/pkg/dashboard/dashboard_memory_guard_test.goindex.html/guard snippetsPer AGENTS.md I did not run
go test,go vet, or localgo build; CI is the test verdict.