Skip to content

feat: event-loop lag monitor with sampling profile (closes #714) - #803

Open
laurentketterle-hub wants to merge 2 commits into
RevoraOrg:masterfrom
laurentketterle-hub:feat/capacity-saturation-alerts-714-ts
Open

feat: event-loop lag monitor with sampling profile (closes #714)#803
laurentketterle-hub wants to merge 2 commits into
RevoraOrg:masterfrom
laurentketterle-hub:feat/capacity-saturation-alerts-714-ts

Conversation

@laurentketterle-hub

Copy link
Copy Markdown
Contributor

Description

Implements event-loop lag monitor with sampling profile for capacity/saturation alerts.

Closes #714

Changes

  • New module: src/monitoring/eventLoopLagMonitor.ts — TypeScript event-loop lag monitor with:
    • Configurable SamplingProfile (window size, sample interval, thresholds)
    • Real-time degradation detection with consecutive-sample tracking
    • Three alert levels: warning (100ms), critical (500ms), saturation (1000ms)
    • P50/P95/P99 percentile statistics
    • Start/stop/reset lifecycle
    • Customizable alert callbacks (onWarning, onCritical, onSaturation)
  • Tests: src/monitoring/__tests__/eventLoopLagMonitor.test.ts — 10 test cases covering:
    • Initial state, start/record/stop lifecycle
    • Lag detection via intendedAt parameter
    • Stats aggregation (min, max, avg, percentiles)
    • Warning/critical/saturation callback firing
    • Reset behavior
    • Default profile values

How to verify

npx jest src/monitoring/__tests__/eventLoopLagMonitor.test.ts

@laurentketterle-hub

Copy link
Copy Markdown
Contributor Author

I claim this bounty. PR ready for review.

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.

Capacity/saturation alerts: event-loop lag alarm with sampling profile capture

1 participant