Comparing version 2.2.1 to 2.2.2
@@ -49,3 +49,3 @@ #!/usr/bin/env node | ||
// also pass binary, if provided. Fallback to simple 'node' | ||
require('./')(args, bin ? argv[ix] : 'node') | ||
require('./')(args, bin ? bin : 'node') | ||
} |
'use strict' | ||
let count = 0, max = 10, res = 0 | ||
var count = 0 | ||
var max = 10 | ||
var res = 0 | ||
console.log('Starting process with simple example.'); | ||
setTimeout(()=>{ | ||
setInterval(()=>{ | ||
console.log(`Starting process(${process.pid}) with simple example.`) | ||
setTimeout(() => { | ||
setInterval(() => { | ||
res += 1 | ||
count++ | ||
console.log(res); | ||
console.log(res) | ||
if (count >= max) { | ||
console.log('Process exited now. Hit ctrl+c'); | ||
console.log('Process exited now. Hit ctrl+c') | ||
return process.exit() | ||
} | ||
}, 10) | ||
}, 500) |
42
index.js
@@ -56,3 +56,3 @@ var fs = require('fs') | ||
if (isNaN(delay)) { delay = 0 } | ||
Error.stackTraceLimit = Infinity | ||
var proc = spawn(node, [ | ||
@@ -68,6 +68,8 @@ '--perf-basic-prof', | ||
} | ||
analyze(true) | ||
}) | ||
var folder | ||
var prof | ||
function start() { | ||
function start () { | ||
prof = spawn('sudo', [profile, '-p', proc.pid]) | ||
@@ -97,3 +99,8 @@ | ||
process.once('SIGINT', function () { | ||
process.once('SIGINT', analyze) | ||
function analyze(manual) { | ||
if (analyze.called) { return } | ||
analyze.called = true | ||
if (!prof) { | ||
@@ -105,4 +112,8 @@ debug('Profiling not begun') | ||
} | ||
debug('Caught SIGINT, generating') | ||
log('Caught SIGINT, generating') | ||
if (!manual) { | ||
debug('Caught SIGINT, generating flamegraph') | ||
log('Caught SIGINT, generating flamegraph ') | ||
} | ||
var clock = spawn(__dirname + '/node_modules/.bin/clockface', {stdio: 'inherit'}) | ||
@@ -144,3 +155,3 @@ process.on('uncaughtException', function (e) { | ||
) | ||
}) | ||
} | ||
} | ||
@@ -188,2 +199,3 @@ | ||
} | ||
analyze(true) | ||
}) | ||
@@ -199,6 +211,13 @@ | ||
process.once('SIGINT', function () { | ||
debug('Caught SIGINT, generating flamegraph') | ||
log('Caught SIGINT, generating flamegraph ') | ||
process.once('SIGINT', analyze) | ||
function analyze (manual) { | ||
if (analyze.called) { return } | ||
analyze.called = true | ||
if (!manual) { | ||
debug('Caught SIGINT, generating flamegraph') | ||
log('Caught SIGINT, generating flamegraph ') | ||
} | ||
var clock = spawn(__dirname + '/node_modules/.bin/clockface', {stdio: 'inherit'}) | ||
@@ -239,3 +258,3 @@ process.on('uncaughtException', function (e) { | ||
}) | ||
} | ||
} | ||
@@ -328,3 +347,5 @@ | ||
debug('done rendering') | ||
clock.kill() | ||
process.exit() | ||
}) | ||
@@ -335,2 +356,3 @@ }) | ||
global.count = 0 | ||
function tidy () { | ||
@@ -337,0 +359,0 @@ debug('tidying up') |
{ | ||
"name": "0x", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -311,2 +311,1 @@ # 0x | ||
MIT and Apache (depending on the code, see LICENSE.md) | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48618959
27
2502
311