Skip to content

feat: Added ability to delay the start of the Profiler and run for n milliseconds before shutting down.#3758

Merged
bizob2828 merged 1 commit intonewrelic:mainfrom
bizob2828:dynamic-profiler
Feb 17, 2026
Merged

feat: Added ability to delay the start of the Profiler and run for n milliseconds before shutting down.#3758
bizob2828 merged 1 commit intonewrelic:mainfrom
bizob2828:dynamic-profiler

Conversation

@bizob2828
Copy link
Member

Description

This PR adds the ability to register an aggregator with a delay and duration property. This in turn will be used when registering the aggregators with the harvester class. If a delay is specified it will delay the start. If a duration is specified it will schedule the aggregator to be stopped. I also tweaked the profiling aggregator slightly to return if the profiling manager actually started any profilers before scheduling the profiling aggregator from running. This still isn't completely wired up so the unit tests only test the functionality with an aggregator in the harvester unit tests.

How to Test

npm run unit

Related Issues

Closes #3753

logger.trace(`${this.method} aggregator started.`)
this.profilingManager.register()
const started = this.profilingManager.start()
if (!started) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not logging any messages as the profiling manager logs a message if there are no registered profilers

@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.73%. Comparing base (a7f06e0) to head (42502ac).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3758       +/-   ##
===========================================
+ Coverage   81.79%   97.73%   +15.93%     
===========================================
  Files         440      453       +13     
  Lines       57186    58600     +1414     
  Branches        1        1               
===========================================
+ Hits        46777    57273    +10496     
+ Misses      10409     1327     -9082     
Flag Coverage Δ
integration-tests-cjs-20.x 74.27% <45.00%> (?)
integration-tests-cjs-22.x 74.31% <45.00%> (?)
integration-tests-cjs-24.x 75.11% <45.00%> (?)
integration-tests-esm-20.x 52.97% <25.00%> (-0.02%) ⬇️
integration-tests-esm-22.x 53.02% <25.00%> (-0.02%) ⬇️
integration-tests-esm-24.x 54.19% <25.00%> (?)
unit-tests-20.x 89.49% <100.00%> (?)
unit-tests-22.x 89.52% <100.00%> (?)
unit-tests-24.x 89.52% <100.00%> (?)
versioned-tests-20.x ?
versioned-tests-22.x ?
versioned-tests-24.x 81.29% <25.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@bizob2828 bizob2828 merged commit 8503d25 into newrelic:main Feb 17, 2026
27 checks passed
@github-project-automation github-project-automation bot moved this from Needs PR Review to Done: Issues recently completed in Node.js Engineering Board Feb 17, 2026
@bizob2828 bizob2828 deleted the dynamic-profiler branch February 17, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done: Issues recently completed

Development

Successfully merging this pull request may close these issues.

[Profiling] Apply the delay and duration configs for profiling

2 participants

Comments