Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
myrotvorets-team committed Oct 14, 2023
1 parent 6793038 commit 6dda36a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/processmetrics.mts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export async function initProcessMetrics(): Promise<void> {
observer.observe(cpuTime, usage.systemCPUTime / 1e6, { state: 'system' });

// cpuUsage is in microseconds, hrtime is in nanoseconds
const elapsedUs = Number((observationTime - lastObservationTime) * 1000n);
const elapsedUs = Number((observationTime - lastObservationTime) / 1000n);
observer.observe(cpuUtilization, (usage.userCPUTime - lastUsage.userCPUTime) / elapsedUs / cpuCount, {
state: 'user',
});
Expand Down

0 comments on commit 6dda36a

Please sign in to comment.