Skip to content

Commit

Permalink
Merge pull request #10 from nearform/preloader-disabler
Browse files Browse the repository at this point in the history
fix: Add a flag to disabled the preloader.
  • Loading branch information
ShogunPanda authored Nov 25, 2020
2 parents 0b41ca8 + 7de6d02 commit be6a8cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Then the tool will await on the next signal, to resume profiling/tracking/shooti

The preloader uses the following environment variables to control its behavior:

- `HEAP_PROFILER_PRELOADER_DISABLED`: If set to `true`, the preloader is not installed and you need to use the API to sample the process.

- `HEAP_PROFILER_SNAPSHOT`: If set to `false`, it will not generate heap dump snapshots.

- `HEAP_PROFILER_SNAPSHOT_DESTINATION`: The path where to store the snapshot. The default will be a `.heapsnapshot` in the current directory.
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const generateHeapSamplingProfile = require('./profile')

module.exports = { generateHeapSnapshot, generateHeapSamplingProfile }

if (require.main === undefined) {
if (process.env.HEAP_PROFILER_PRELOADER_DISABLED !== 'true' && require.main === undefined) {
let logger = console

if (process.env.HEAP_PROFILER_LOGGING_DISABLED === 'true') {
Expand Down

0 comments on commit be6a8cd

Please sign in to comment.