examination
Thoroughly examine the state of a Node.js process. examination
allows a heap snapshot, diagnostics report, and core dump to be generated and written to an output directory with a single function call.
Basic Usage
'use strict';const Examination = ; // Dump the report, core, and heap snapshot to the __dirname directory.; // Alternatively... // Create a reusable bound function that only writes a heap snapshot and// diagnostics report to /tmp/foo.const bound = Examination; ;
API
examination(options, callback)
- Arguments
options
(object) - A configuration object supporting the following schema.directory
(string) - The directory where the output files will be written. If this directory (including any parent directories) does not exist, it will be created.heapdump
(boolean) - Iftrue
, a heap snapshot will be written todirectory
. Defaults tofalse
.report
(boolean) - Iftrue
, a diagnostics report will be written todirectory
. Defaults tofalse
.core
(boolean) - Iftrue
, an archive containing a core file and all loaded native libraries will be written todirectory
. Defaults tofalse
. Note that generating these files in particular will take time and consume considerable disk space.error
(error) -
callback
(function) - A function that is called after all artifacts have been created. This function takes the following arguments.err
(error) - Represents any error that occurs. Note that the artifacts are created in parallel, so it is possible to receive an error here and still have one or more output files written.
- Returns
- Nothing