Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

cjihrig/examination

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

examination

Current Version Build Status via Travis CI Dependencies belly-button-style

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 = require('examination');

// Dump the report, core, and heap snapshot to the __dirname directory.
Examination({
  directory: __dirname,
  heapdump: true,
  report: true,
  core: true
}, (err) => {
  if (err) {
    // Handle error
  }
});

// Alternatively...

// Create a reusable bound function that only writes a heap snapshot and
// diagnostics report to /tmp/foo.
const bound = Examination.bind(null, {
  directory: '/tmp/foo',
  heapdump: true,
  report: true
}, (err) => { /* Ignore error */ });

bound();

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) - If true, a heap snapshot will be written to directory. Defaults to false.
      • report (boolean) - If true, a diagnostics report will be written to directory. Defaults to false.
      • core (boolean) - If true, an archive containing a core file and all loaded native libraries will be written to directory. Defaults to false. Note that generating these files in particular will take time and consume considerable disk space.
      • error (error) - If an error is included, it is included in the node-report diagnostics.
    • 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

About

Thoroughly examine the state of a Node.js process

Resources

License

Stars

Watchers

Forks

Packages

No packages published