Skip to content

cherry-pick: fix(analytics): report aggregate maxDepth as the sum of per-thread peaks (#3017 → v5.3) - #3125

Merged
kriszyp merged 3 commits into
v5.3from
cherry-pick/v5.3/pr-3017
Oct 8, 2026
Merged

kriszyp merged 3 commits into
v5.3from
cherry-pick/v5.3/pr-3017

Conversation

@kriszyp

@kriszyp kriszyp commented Oct 8, 2026

Copy link
Copy Markdown
Member

Cherry-pick of fix(analytics): report aggregate maxDepth as the sum of per-thread peaks onto v5.3 for 5.3.2.

The release-cherry-pick bot built cherry-pick/v5.3/pr-3017 and its integration tests passed (run), but the branch was never fast-forwarded into v5.3. It merges cleanly onto the current v5.3 and changes only resources/analytics/write.ts and its unit test (+77/−1).

Merged at the release owner's direction during the v5.3.2 cut.

🤖 Generated with Claude Code

kriszyp and others added 3 commits October 5, 2026 16:21
Aggregation folded every numeric measure as a running mean, so the
aggregate maxDepth of the transaction-queue-depth gauges was a sum of
per-thread means of per-sample peaks: neither a peak nor a bound.
Peak-named measures (/^max[A-Z]/) now fold with Math.max within a
thread across the period's samples. Across threads the per-thread
peaks are still summed.

Dispatch-Task: harper-analytics-maxdepth-aggregation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CmFNiYmUGvY7X6mvX3PUgb
… test

The cross-thread comment now states when summed peaks bound concurrent
depth. The aggregation test disables live recording before seeding so
the main thread's pending report cannot land inside its windows.

Dispatch-Task: harper-analytics-maxdepth-aggregation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CmFNiYmUGvY7X6mvX3PUgb
Waiting one period and running a cycle after disabling recording lets an
in-flight flush finish and consumes any report it left above the cursor,
so no live main-thread report lands in the fixture windows. The probe's
additive-named measure is maxCount, so the test no longer codifies a
summed latency.

Dispatch-Task: harper-analytics-maxdepth-aggregation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CmFNiYmUGvY7X6mvX3PUgb
@kriszyp kriszyp added this to the v5.3 milestone Oct 8, 2026
@kriszyp
kriszyp merged commit e42a0e3 into v5.3 Oct 8, 2026
53 of 55 checks passed
@kriszyp
kriszyp deleted the cherry-pick/v5.3/pr-3017 branch October 8, 2026 23:04

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the analytics aggregation cycle in resources/analytics/write.ts to aggregate peak-named measures (matching /^max[A-Z]/) using Math.max rather than a weighted average. It also introduces helper functions and a comprehensive unit test in unitTests/resources/analytics/aggregationCycle.test.js to validate that peak-named measures correctly sum per-thread peaks across threads. No review comments were provided for this pull request, and we have no further feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant