Skip to content

feat(metrics): report event-loop lag in process metrics payload (#292) - #306

Merged
David-patrick-chuks-02 merged 2 commits into
Lilly-Protocol:mainfrom
ghzhost:feat/metrics-event-loop-lag-292
Sep 6, 2026
Merged

feat(metrics): report event-loop lag in process metrics payload (#292)#306
David-patrick-chuks-02 merged 2 commits into
Lilly-Protocol:mainfrom
ghzhost:feat/metrics-event-loop-lag-292

Conversation

@ghzhost

@ghzhost ghzhost commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves #292 by adding event-loop lag estimation to the process metrics payload.

Changes

  • Implemented a lightweight, stoppable event loop lag sampler in src/modules/metrics/event-loop-lag.ts using process.hrtime.bigint().
  • Exposed eventLoopLagMs on ProcessMetrics returned by metricsService.getMetrics().
  • Extended tests/metrics.test.ts to assert eventLoopLagMs is present, finite, and non-negative.

Acceptance Criteria Verified

  • GET /api/v1/metrics includes finite non-negative eventLoopLagMs
  • Sampler is stoppable and cleanly unref'd to prevent timer leaks
  • tests/metrics.test.ts passes successfully

ghzhost and others added 2 commits September 3, 2026 06:10
…y-Protocol#292)

- Add lightweight eventLoopLagMs sampler using high-resolution hrtime
- Include eventLoopLagMs in ProcessMetrics payload
- Extend metrics.test.ts to verify presence and bounds of eventLoopLagMs
- Ensure sampler cleanup hook for graceful shutdown and tests
@David-patrick-chuks-02
David-patrick-chuks-02 merged commit d737553 into Lilly-Protocol:main Sep 6, 2026
1 check failed
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.

[Bounty: $100] Report event-loop lag in the process metrics payload

3 participants