Remove use of const from packager and add systrace internally

Reviewed By: @martinbigio

Differential Revision: D2471270
This commit is contained in:
Tadeu Zagallo 2015-09-23 10:54:26 -07:00 committed by facebook-github-bot-5
parent 0e8f6e4ed3
commit 1ce0853c39
1 changed files with 5 additions and 5 deletions

View File

@ -220,9 +220,9 @@ function systraceProfileMiddleware(req, res, next) {
}
console.log('Dumping profile information...');
const dumpName = '/tmp/dump_' + Date.now() + '.json';
const prefix = process.env.TRACE_VIEWER_PATH || '';
const cmd = path.join(prefix, 'trace2html') + ' ' + dumpName;
var dumpName = '/tmp/dump_' + Date.now() + '.json';
var prefix = process.env.TRACE_VIEWER_PATH || '';
var cmd = path.join(prefix, 'trace2html') + ' ' + dumpName;
fs.writeFileSync(dumpName, req.rawBody);
childProcess.exec(cmd, function(error) {
if (error) {
@ -258,10 +258,10 @@ function cpuProfileMiddleware(req, res, next) {
}
console.log('Dumping CPU profile information...');
const dumpName = '/tmp/cpu-profile_' + Date.now();
var dumpName = '/tmp/cpu-profile_' + Date.now();
fs.writeFileSync(dumpName + '.json', req.rawBody);
const cmd = path.join(__dirname, '..', 'JSCLegacyProfiler', 'json2trace') + ' -cpuprofiler ' + dumpName + '.cpuprofile ' + dumpName + '.json';
var cmd = path.join(__dirname, '..', 'JSCLegacyProfiler', 'json2trace') + ' -cpuprofiler ' + dumpName + '.cpuprofile ' + dumpName + '.json';
childProcess.exec(cmd, function(error) {
if (error) {
console.error(error);