X Tutup
The Wayback Machine - https://web.archive.org/web/20250814212401/https://github.com/nodejs/node/pull/59177
Skip to content

worker: add cpuUsage for worker #59177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

theanarkh
Copy link
Contributor

Add worker.cpuUsage for worker, like worker.getHeapStatistics and worker.getHeapSnapshot.

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Jul 22, 2025
@theanarkh theanarkh force-pushed the add_thread_cpu_usage_for_worker branch from 3725695 to 09d2711 Compare July 22, 2025 18:55
@theanarkh theanarkh added the worker Issues and PRs related to Worker support. label Jul 22, 2025
@theanarkh theanarkh force-pushed the add_thread_cpu_usage_for_worker branch from 09d2711 to 05fdd47 Compare July 22, 2025 19:02
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

❌ Patch coverage is 81.05263% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.04%. Comparing base (049664b) to head (911849d).
⚠️ Report is 84 commits behind head on main.

Files with missing lines Patch % Lines
src/node_worker.cc 80.32% 7 Missing and 5 partials ⚠️
lib/internal/worker.js 82.35% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #59177      +/-   ##
==========================================
- Coverage   90.06%   90.04%   -0.02%     
==========================================
  Files         645      648       +3     
  Lines      189130   191072    +1942     
  Branches    37094    37446     +352     
==========================================
+ Hits       170339   172060    +1721     
- Misses      11511    11617     +106     
- Partials     7280     7395     +115     
Files with missing lines Coverage Δ
src/node_worker.h 90.90% <ø> (ø)
lib/internal/worker.js 98.82% <82.35%> (-1.01%) ⬇️
src/node_worker.cc 83.97% <80.32%> (-0.60%) ⬇️

... and 98 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@theanarkh theanarkh force-pushed the add_thread_cpu_usage_for_worker branch 2 times, most recently from 543312c to 5cd7ec0 Compare July 23, 2025 10:47
@theanarkh
Copy link
Contributor Author

Thanks for the review. I've updated the code. Please help review again.

@theanarkh theanarkh force-pushed the add_thread_cpu_usage_for_worker branch from 5cd7ec0 to 911849d Compare July 23, 2025 12:47
@theanarkh theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 23, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 23, 2025
@theanarkh theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 24, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 24, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@theanarkh theanarkh added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 24, 2025
@theanarkh theanarkh added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 28, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 28, 2025
@nodejs-github-bot nodejs-github-bot merged commit 0ba6e0d into nodejs:main Jul 28, 2025
67 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 0ba6e0d

meteorqz6 pushed a commit to meteorqz6/node that referenced this pull request Aug 2, 2025
PR-URL: nodejs#59177
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
targos pushed a commit that referenced this pull request Aug 8, 2025
PR-URL: #59177
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
X Tutup