Skip to content

Commit 75ea38f

Browse files
committed
fix(webapp): rotate ELU baseline so it reports per-interval, not cumulative
lastEventLoopUtilization was set once at init and never reassigned, so every performance.eventLoopUtilization(current, last) diff was computed against the process-start snapshot. The nodejs.event_loop.utilization gauge was therefore a cumulative average over process lifetime rather than a per-interval measurement. Rotate the baseline immediately after computing the diff.
1 parent 574733b commit 75ea38f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

apps/webapp/app/v3/tracer.server.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,9 @@ function configureNodejsMetrics({ meter }: { meter: Meter }) {
717717
currentEventLoopUtilization,
718718
lastEventLoopUtilization
719719
);
720+
// Rotate the baseline so the next collection reports per-interval
721+
// utilization rather than the cumulative average from process start.
722+
lastEventLoopUtilization = currentEventLoopUtilization;
720723

721724
// diff.utilization is between 0 and 1 (fraction of time "active")
722725
const utilization = Number.isFinite(diff.utilization) ? diff.utilization : 0;

0 commit comments

Comments
 (0)