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 ae5b099

Command Status Duration Result
nx affected -t int-test --parallel=3 ✅ Succeeded 1m 31s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-27 14:49:02 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: ae5b099

@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 61ecb4f 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 🔴 34 ↓ −2.2
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, 👍 7 audits improved, 👎 7 audits regressed, 13 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 🔴 34 ↓ −2.2
Code coverage Code coverage metrics 🟢 93 🟢 93 ↓ −0.1

31 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Initial server response time was short 🟩 Root document took 490 ms 🟥 Root document took 630 ms ↑ +28.9 %
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 Speed Index 🟥 6.8 s 🟥 7.8 s ↑ +14.6 %
Lighthouse First Contentful Paint 🟥 3.1 s 🟥 3.2 s ↑ +5.3 %
Lighthouse Time to Interactive 🟥 13.3 s 🟥 14.1 s ↑ +6 %
Lighthouse Total Blocking Time 🟥 1,810 ms 🟥 2,010 ms ↑ +11.6 %
JSDocs coverage Variables coverage 🟥 280 undocumented variables 🟥 273 undocumented variables ↓ −2.5 %
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,087 KiB ↓ −0.2 %
Lighthouse Metrics 🟩 100% 🟩 100% ↑ +6 %
Lighthouse Minimizes main-thread work 🟥 12.1 s 🟥 11.4 s ↓ −6 %
Lighthouse Uses efficient cache policy on static assets 🟨 31 resources found 🟨 31 resources found ↓ −0.1 %
Lighthouse Server Backend Latencies 🟩 660 ms 🟩 290 ms ↓ −56 %
Lighthouse Largest Contentful Paint 🟥 11.8 s 🟥 11.4 s ↓ −3 %
Lighthouse JavaScript execution time 🟥 4.9 s 🟥 4.6 s ↓ −5.6 %
Lighthouse Max Potential First Input Delay 🟥 1,300 ms 🟥 1,150 ms ↓ −11.8 %
Lighthouse Reduce unused JavaScript 🟥 Potential savings of 226 KiB 🟥 Potential savings of 226 KiB ↑ +6.6 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 125 KiB 🟥 Potential savings of 125 KiB ↑ +8.3 %
Lighthouse Network Round Trip Times 🟩 0 ms 🟩 50 ms ↑ +2020.8 %
Lighthouse Remove duplicate modules in JavaScript bundles 🟥 Potential savings of 85 KiB 🟥 Potential savings of 88 KiB ↑ +6.7 %
TypeScript Semantic errors 🟥 25 errors 🟥 36 errors ↑ +44 %

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 61ecb4f 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
# 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
Co-authored-by: Hanna Skryl <80118140+hanna-skryl@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Jan 27, 2026

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on February 26.

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

@BioPhoton BioPhoton requested a review from hanna-skryl January 27, 2026 14:25
Co-authored-by: Hanna Skryl <80118140+hanna-skryl@users.noreply.github.com>
@BioPhoton BioPhoton requested a review from hanna-skryl January 27, 2026 14:28
@BioPhoton BioPhoton enabled auto-merge (squash) January 27, 2026 14:34
@BioPhoton BioPhoton merged commit ea196f9 into main Jan 27, 2026
35 of 36 checks passed
@BioPhoton BioPhoton deleted the feat/utils/profiler-perf-buffer branch January 27, 2026 14:49
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