mirror of
https://github.com/NodeDaemon/NodeDaemon.git
synced 2026-04-27 08:15:55 +03:00
[PR #3] [MERGED] Find and fix a verifiable bug with tests #3
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/NodeDaemon#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/NodeDaemon/NodeDaemon/pull/3
Author: @ersinkoc
Created: 11/5/2025
Status: ✅ Merged
Merged: 11/5/2025
Merged by: @ersinkoc
Base:
main← Head:claude/identify-and-fix-bug-011CUpiRtuykqgjV96ntLW4Q📝 Commits (1)
9115e8dfix: replace Math.random() with 0 for Windows CPU metrics📊 Changes
3 files changed (+330 additions, -1 deletions)
View changed files
📝
src/core/HealthMonitor.ts(+3 -1)➕
tests/unit/health-monitor-cpu-bug.test.js(+205 -0)➕
tests/unit/health-monitor-no-random-cpu.test.js(+122 -0)📄 Description
Bug: HealthMonitor.getWindowsMetrics() was using Math.random() * 10 as the CPU percentage value when typeperf output parsing was incomplete. This resulted in random, incorrect CPU metrics on Windows systems.
Impact:
Fix:
Tests:
Location: src/core/HealthMonitor.ts:375
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.