Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5d8dce4

Browse filesBrowse files
TrottBridgeAR
authored andcommitted
test: document cpu-prof module
PR-URL: #28183 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 41af9bf commit 5d8dce4
Copy full SHA for 5d8dce4

File tree

Expand file treeCollapse file tree

1 file changed

+42
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+42
-0
lines changed
Open diff view settings
Collapse file

‎test/common/README.md‎

Copy file name to clipboardExpand all lines: test/common/README.md
+42Lines changed: 42 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This directory contains modules used to test the Node.js implementation.
88
* [Benchmark module](#benchmark-module)
99
* [Common module API](#common-module-api)
1010
* [Countdown module](#countdown-module)
11+
* [CPU Profiler module](#cpu-profiler-module)
1112
* [DNS module](#dns-module)
1213
* [Duplex pair helper](#duplex-pair-helper)
1314
* [Environment variables](#environment-variables)
@@ -431,6 +432,47 @@ Decrements the `Countdown` counter.
431432
Specifies the remaining number of times `Countdown.prototype.dec()` must be
432433
called before the callback is invoked.
433434

435+
## CPU Profiler module
436+
437+
The `cpu-prof` module provides utilities related to CPU profiling tests.
438+
439+
### env
440+
441+
* Default: { ...process.env, FIB, NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER' }
442+
443+
Environment variables used in profiled processes. FIB will be set to `40` on
444+
Windows and `30` elsewhere.
445+
446+
### getCpuProfiles(dir)
447+
448+
* `dir` {string} The directory containing the CPU profile files.
449+
* return [&lt;string>]
450+
451+
Returns an array of all `.cpuprofile` files found in `dir`.
452+
453+
### getFrames(output, file, suffix)
454+
455+
* `output` Unused.
456+
* `file` {string} Path to a `.cpuprofile` file.
457+
* `suffix` {string} Suffix of the URL of call frames to retrieve.
458+
* returns { frames: [&lt;Object>], nodes: [&lt;Object>] }
459+
460+
Returns an object containing an array of the relevant call frames and an array
461+
of all the profile nodes.
462+
463+
### kCpuProfInterval
464+
465+
Sampling interval in microseconds.
466+
467+
### verifyFrames(output, file, suffix)
468+
469+
* `output` {string}
470+
* `file` {string}
471+
* `suffix` {string}
472+
473+
Throws an `AssertionError` if there are no call frames with the expected
474+
`suffix` in the profiling data contained in `file`.
475+
434476
## DNS Module
435477

436478
The `DNS` module provides utilities related to the `dns` built-in module.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.