Skip to content

Commit

Permalink
test: document cpu-prof module
Browse files Browse the repository at this point in the history
PR-URL: #28183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and targos committed Jun 18, 2019
1 parent 81a1a13 commit 58eccb1
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This directory contains modules used to test the Node.js implementation.
* [Benchmark module](#benchmark-module)
* [Common module API](#common-module-api)
* [Countdown module](#countdown-module)
* [CPU Profiler module](#cpu-profiler-module)
* [DNS module](#dns-module)
* [Duplex pair helper](#duplex-pair-helper)
* [Environment variables](#environment-variables)
Expand Down Expand Up @@ -431,6 +432,47 @@ Decrements the `Countdown` counter.
Specifies the remaining number of times `Countdown.prototype.dec()` must be
called before the callback is invoked.

## CPU Profiler module

The `cpu-prof` module provides utilities related to CPU profiling tests.

### env

* Default: { ...process.env, FIB, NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER' }

Environment variables used in profiled processes. FIB will be set to `40` on
Windows and `30` elsewhere.

### getCpuProfiles(dir)

* `dir` {string} The directory containing the CPU profile files.
* return [&lt;string>]

Returns an array of all `.cpuprofile` files found in `dir`.

### getFrames(output, file, suffix)

* `output` Unused.
* `file` {string} Path to a `.cpuprofile` file.
* `suffix` {string} Suffix of the URL of call frames to retrieve.
* returns { frames: [&lt;Object>], nodes: [&lt;Object>] }

Returns an object containing an array of the relevant call frames and an array
of all the profile nodes.

### kCpuProfInterval

Sampling interval in microseconds.

### verifyFrames(output, file, suffix)

* `output` {string}
* `file` {string}
* `suffix` {string}

Throws an `AssertionError` if there are no call frames with the expected
`suffix` in the profiling data contained in `file`.

## DNS Module

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

0 comments on commit 58eccb1

Please sign in to comment.