diff options
author | Rich Trott <rtrott@gmail.com> | 2019-06-11 13:54:19 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-06-13 23:01:38 -0700 |
commit | 06c818a464b58831ed7be37e5a8412fc9a9b6eae (patch) | |
tree | ccf1256c9ee28100622fb5fbb95a493a8e22b5f9 /test/common | |
parent | 8cdc1bdad693266d88193a8ce87400c715c576bf (diff) | |
download | android-node-v8-06c818a464b58831ed7be37e5a8412fc9a9b6eae.tar.gz android-node-v8-06c818a464b58831ed7be37e5a8412fc9a9b6eae.tar.bz2 android-node-v8-06c818a464b58831ed7be37e5a8412fc9a9b6eae.zip |
test: document cpu-prof module
PR-URL: https://github.com/nodejs/node/pull/28183
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/common')
-rw-r--r-- | test/common/README.md | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/common/README.md b/test/common/README.md index 9c0d150b78..a60a60ce20 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -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) @@ -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 [<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: [<Object>], nodes: [<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. |