Skip to content

feat(grouper): add slow handle diagnostics#549

Merged
neSpecc merged 6 commits into
masterfrom
feat/grouper-slow-diagnostics
Jun 3, 2026
Merged

feat(grouper): add slow handle diagnostics#549
neSpecc merged 6 commits into
masterfrom
feat/grouper-slow-diagnostics

Conversation

@Kuchizu
Copy link
Copy Markdown
Member

@Kuchizu Kuchizu commented May 4, 2026

Adds Grouper slow-handle diagnostics to identify which processing step causes high handle duration.

Comment thread workers/grouper/src/index.ts Outdated
Comment thread workers/grouper/src/index.ts Outdated
@Kuchizu Kuchizu requested a review from neSpecc May 6, 2026 12:18
neSpecc
neSpecc previously approved these changes May 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds slow-handle diagnostics to the Grouper worker to help pinpoint which parts of handleInternal() contribute most to high end-to-end handle duration.

Changes:

  • Introduces SlowHandleDiagnostics / SlowHandleSession to time per-handle steps and emit a slow-handle warning with a step breakdown.
  • Extends GrouperMetrics with a per-step duration histogram and custom handle-duration buckets.
  • Adds env-driven diagnostics config (GROUPER_SLOW_HANDLE_WARN_MS) and instruments handleInternal() plus several Mongo operations.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
workers/grouper/src/metrics/slowHandleDiagnostics.ts New per-handle session helper that measures steps and logs a slow-handle breakdown.
workers/grouper/src/metrics/grouperMetrics.ts Adds GrouperStep + step-duration histogram and custom handle-duration buckets.
workers/grouper/src/metrics/config.ts Adds diagnostics config + env parsing for slow-handle warning threshold.
workers/grouper/src/index.ts Instruments handleInternal() steps, adds slow-handle session usage, and wraps additional Mongo ops for duration metrics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread workers/grouper/src/metrics/slowHandleDiagnostics.ts
Comment thread workers/grouper/src/metrics/slowHandleDiagnostics.ts
Comment thread workers/grouper/src/index.ts
Comment thread workers/grouper/src/index.ts
@neSpecc neSpecc merged commit c45a7db into master Jun 3, 2026
5 checks passed
@neSpecc neSpecc deleted the feat/grouper-slow-diagnostics branch June 3, 2026 13:58
Kuchizu added a commit that referenced this pull request Jun 3, 2026
* feat(grouper): add slow handle diagnostics

* refactor(grouper): extract slow handle diagnostics into session

* fix(grouper): use monotonic time and exclusive timings in slow handle diagnostics

Co-authored-by: Kuchizu <70284260+Kuchizu@users.noreply.github.com>
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.

3 participants