Added memory profiler configuration options.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const config = require('config');
|
||||
const util = require('util');
|
||||
const log = require('why-is-node-running');
|
||||
const Inspector = require('inspector-api');
|
||||
@@ -84,7 +85,7 @@ async function startMemorySample(snapshotTriggers = []) {
|
||||
async function init() {
|
||||
try {
|
||||
if (argv.sampleMemory) {
|
||||
await startMemorySample([1000]);
|
||||
await startMemorySample(config.memorySampling.snapshotIntervals);
|
||||
}
|
||||
|
||||
if (argv.logActive) {
|
||||
|
||||
@@ -247,6 +247,12 @@ const { argv } = yargs
|
||||
type: 'boolean',
|
||||
default: process.env.NODE_ENV === 'development',
|
||||
})
|
||||
.option('sampleMemory', {
|
||||
alias: 'memory',
|
||||
describe: 'Take memory allocation samples, and snapshots at configured intervals',
|
||||
type: 'boolean',
|
||||
default: config.memorySampling.enabled,
|
||||
})
|
||||
.option('update-search', {
|
||||
describe: 'Update search documents for all releases.',
|
||||
type: 'boolean',
|
||||
|
||||
Reference in New Issue
Block a user