Skip to content

Conversation

@BioPhoton
Copy link
Collaborator

@BioPhoton BioPhoton commented Jan 16, 2026

Related: #1197

This PR includes:

  • adding NodeJSProfiler class
  • implemented performanceObserver for NodeJSProfiler
  • revamp PerformanceObserverSink - add getStatus for better testing, more robust and memory friendly buffer logic

Followup PRs:


Note

Introduces a Node.js runtime profiler with buffered write-ahead logging and a redesigned performance observer.

  • Adds NodejsProfiler (extends Profiler) with WAL sink integration, runtime enable/disable, state transitions, flush() and stats access; supports debug transition markers via CP_PROFILER_DEBUG
  • Replaces PerformanceObserverSink internals with bounded queue, proactive flushing (flushThreshold), maxQueueSize, encode-failure debug marks, and getStats(); validates configuration and handles sink errors gracefully
  • Expands WAL AppendableSink contract to include isClosed, optional open/close, and recovery APIs; updates mocks to MockAppendableSink/MockTraceEventFileSink
  • Adds comprehensive unit/integration tests and new profiler.md docs covering configuration, API, and Node.js usage
  • Minor: default exitOnFatal/exitOnSignal set to false in exit handlers

Written by Cursor Bugbot for commit 66523e3. This will update automatically on new commits. Configure here.

- Add explanation that sink determines output format (DevTools TraceEvent, OpenTelemetry, etc.)
- Improve documentation clarity for flexible serialization capabilities
- Fix duplicate imports in profiler unit test
- Replace method implementations with vi.fn() spy functions
- Add vi import from vitest
- Enables better testing with call tracking and assertions
@github-actions github-actions bot added 📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests 🧩 utils labels Jan 16, 2026
@nx-cloud
Copy link

nx-cloud bot commented Jan 16, 2026

View your CI Pipeline Execution ↗ for commit 66523e3

Command Status Duration Result
nx run ci:code-pushup -- merge-diffs --files=/h... ✅ Succeeded 5s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 1m 37s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 13m 28s View ↗
nx run-many -t unit-test,int-test ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-27 00:43:57 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 16, 2026

Open in StackBlitz

@code-pushup/ci

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/ci@1219

@code-pushup/cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/cli@1219

@code-pushup/core

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/core@1219

@code-pushup/create-cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/create-cli@1219

@code-pushup/models

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models@1219

@code-pushup/nx-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1219

@code-pushup/axe-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/axe-plugin@1219

@code-pushup/coverage-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/coverage-plugin@1219

@code-pushup/eslint-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/eslint-plugin@1219

@code-pushup/js-packages-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/js-packages-plugin@1219

@code-pushup/jsdocs-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/jsdocs-plugin@1219

@code-pushup/lighthouse-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/lighthouse-plugin@1219

@code-pushup/typescript-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/typescript-plugin@1219

@code-pushup/utils

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/utils@1219

commit: 66523e3

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit 3cf7bef with previous commit e677d4f.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Documentation 🔴 46 🟡 53 ↑ +6.7
Performance 🔴 36 🔴 35 ↓ −0.8
Code coverage 🟢 93 🟢 93 ↓ −0.1
Bug prevention 🟡 75 🟡 75 ↓ −0.1
Axe Accessibility 🟡 88 🟡 88 ↓ −0.1
Code style 🟢 100 🟢 100
Security 🔴 47 🔴 47
Updates 🟡 78 🟡 78
Type Safety 🟡 67 🟡 67
Miscellaneous 🟡 67 🟡 67
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟢 92 🟢 92
👍 1 group improved, 👎 2 groups regressed, 👍 8 audits improved, 👎 4 audits regressed, 15 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
JSDocs coverage Documentation coverage 🔴 46 🟡 53 ↑ +6.7
Lighthouse Performance 🔴 36 🔴 35 ↓ −0.8
Code coverage Code coverage metrics 🟢 93 🟢 93 ↓ −0.1

31 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
JSDocs coverage Properties coverage 🟥 41 undocumented properties 🟥 38 undocumented properties ↓ −7.3 %
JSDocs coverage Methods coverage 🟨 15 undocumented methods 🟨 11 undocumented methods ↓ −26.7 %
JSDocs coverage Classes coverage 🟨 6 undocumented classes 🟨 5 undocumented classes ↓ −16.7 %
Lighthouse First Contentful Paint 🟥 3.1 s 🟥 3.4 s ↑ +10.4 %
Lighthouse Speed Index 🟥 6.8 s 🟥 6.7 s ↓ −1.6 %
JSDocs coverage Variables coverage 🟥 280 undocumented variables 🟥 273 undocumented variables ↓ −2.5 %
Lighthouse Time to Interactive 🟥 13.3 s 🟥 13.7 s ↑ +2.6 %
JSDocs coverage Types coverage 🟥 262 undocumented types 🟥 261 undocumented types ↓ −0.4 %
JSDocs coverage Functions coverage 🟥 582 undocumented functions 🟥 582 undocumented functions  +0 %
Code coverage Line coverage 🟩 92.6 % 🟩 92.7 % ↑ +0.1 %
Code coverage Branch coverage 🟨 89.2 % 🟨 89.2 % ↓ −0.1 %
Code coverage Function coverage 🟩 94.3 % 🟩 94.3 % ↓ −0.1 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 2,091 KiB 🟩 Total size was 2,095 KiB ↑ +0.2 %
Lighthouse Minimizes main-thread work 🟥 12.1 s 🟥 11.2 s ↓ −7.8 %
Lighthouse Uses efficient cache policy on static assets 🟨 31 resources found 🟨 31 resources found ↓ −0.1 %
Lighthouse Metrics 🟩 100% 🟩 100% ↑ +2.6 %
Lighthouse JavaScript execution time 🟥 4.9 s 🟥 4.5 s ↓ −7 %
Lighthouse Largest Contentful Paint 🟥 11.8 s 🟥 12.1 s ↑ +2.2 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 125 KiB 🟥 Potential savings of 125 KiB ↑ +26.7 %
Lighthouse Remove duplicate modules in JavaScript bundles 🟥 Potential savings of 85 KiB 🟥 Potential savings of 88 KiB ↑ +53.3 %
Lighthouse Server Backend Latencies 🟩 660 ms 🟩 790 ms ↑ +19.1 %
Lighthouse Network Round Trip Times 🟩 0 ms 🟩 60 ms ↑ +2608.1 %
Lighthouse Total Blocking Time 🟥 1,810 ms 🟥 1,850 ms ↑ +2.5 %
Lighthouse Initial server response time was short 🟩 Root document took 490 ms 🟩 Root document took 450 ms ↓ −8.7 %
Lighthouse Max Potential First Input Delay 🟥 1,300 ms 🟥 1,290 ms ↓ −1.2 %
TypeScript Semantic errors 🟥 25 errors 🟥 36 errors ↑ +44 %
Lighthouse Reduce unused JavaScript 🟥 Potential savings of 226 KiB 🟥 Potential savings of 226 KiB ↑ +0.9 %

652 other audits are unchanged.

@BioPhoton BioPhoton marked this pull request as ready for review January 16, 2026 22:22
@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit 3cf7bef with previous commit e677d4f.

💼 Project utils

🤨 Code PushUp report has both improvements and regressions.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Documentation 🟡 51 🟡 60 ↑ +8.6
Code coverage 🟢 95 🟢 95 ↓ −0.1

4 other categories are unchanged.

👍 1 group improved, 👎 1 group regressed, 👍 7 audits improved, 👎 2 audits regressed

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
JSDocs coverage Documentation coverage 🟡 51 🟡 60 ↑ +8.6
Code coverage Code coverage metrics 🟢 95 🟢 95 ↓ −0.1

13 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
JSDocs coverage Properties coverage 🟥 38 undocumented properties 🟥 35 undocumented properties ↓ −7.9 %
JSDocs coverage Methods coverage 🟨 15 undocumented methods 🟨 11 undocumented methods ↓ −26.7 %
JSDocs coverage Classes coverage 🟨 3 undocumented classes 🟨 2 undocumented classes ↓ −33.3 %
JSDocs coverage Variables coverage 🟥 57 undocumented variables 🟥 50 undocumented variables ↓ −12.3 %
JSDocs coverage Types coverage 🟨 56 undocumented types 🟨 55 undocumented types ↓ −1.8 %
JSDocs coverage Functions coverage 🟥 244 undocumented functions 🟥 244 undocumented functions  +0 %
Code coverage Branch coverage 🟩 92.2 % 🟩 92 % ↓ −0.2 %
Code coverage Function coverage 🟩 96 % 🟩 95.9 % ↓ −0.1 %
Code coverage Line coverage 🟩 97.9 % 🟩 97.9 % ↑ +0.1 %

435 other audits are unchanged.


13 other projects are unchanged.

Co-authored-by: Hanna Skryl <80118140+hanna-skryl@users.noreply.github.com>
@BioPhoton BioPhoton requested a review from hanna-skryl January 18, 2026 17:41
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

# Conflicts:
#	packages/utils/src/lib/profiler/profiler.int.test.ts
#	packages/utils/src/lib/profiler/profiler.unit.test.ts
@BioPhoton BioPhoton requested a review from hanna-skryl January 26, 2026 20:59
BioPhoton and others added 4 commits January 27, 2026 00:22
Co-authored-by: Hanna Skryl <80118140+hanna-skryl@users.noreply.github.com>
Co-authored-by: Hanna Skryl <80118140+hanna-skryl@users.noreply.github.com>
Co-authored-by: Hanna Skryl <80118140+hanna-skryl@users.noreply.github.com>
Co-authored-by: Hanna Skryl <80118140+hanna-skryl@users.noreply.github.com>
@BioPhoton BioPhoton requested a review from hanna-skryl January 26, 2026 23:40
# Conflicts:
#	packages/utils/mocks/sink.mock.ts
#	packages/utils/src/lib/performance-observer.int.test.ts
#	packages/utils/src/lib/performance-observer.ts
#	packages/utils/src/lib/performance-observer.unit.test.ts
#	packages/utils/src/lib/profiler/constants.ts
#	packages/utils/src/lib/profiler/profiler.ts
#	packages/utils/src/lib/profiler/profiler.unit.test.ts
#	packages/utils/src/lib/sink-source.type.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests 🧩 utils

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants