Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #518 from caridy/enabling-perf

enhancement for perf and profiler
  • Loading branch information...
commit e77f7e5fed679fa560a849139d948e28ddc56be5 2 parents 0ac25eb + 15d7332
@imalberto imalberto authored
Showing with 14 additions and 4 deletions.
  1. +1 −1  lib/app/autoload/perf.server.js
  2. +13 −3 lib/app/commands/profiler.js
View
2  lib/app/autoload/perf.server.js
@@ -46,7 +46,7 @@ YUI.add('mojito-perf', function (Y, NAME) {
i;
try {
- outstream = libfs.createWriteStream(filename, {
+ outstream = libfs.createWriteStream(filename.replace('{req}', requestId), {
flags: 'a' // append
});
for (i = 0; i < logs.length; i += 1) {
View
16 lib/app/commands/profiler.js
@@ -221,13 +221,16 @@ function svgDraw(file, log) {
run = function(params, options) {
var env,
store,
- inFile = 'perf.log',
+ inFile,
outFile,
lines,
log;
options = options || {};
+ // default input if --input filename.ext is not set
+ inFile = options.input || 'perf.log';
+
if (params.length) {
libutils.error('Unknown extra parameters.');
return;
@@ -255,13 +258,20 @@ run = function(params, options) {
/**
* Standard usage string export.
*/
-exports.usage = 'mojito profiler // generates an SVG image of the profiling log\n';
+exports.usage = 'mojito profiler // generates an SVG image of the profiling log\n' +
+ '\t--input Path and filename of the input file (default value perf.log).\n';
/**
* Standard options list export.
*/
-exports.options = [];
+exports.options = [
+ {
+ longName: 'input',
+ shortName: null,
+ hasValue: true
+ }
+];
/**
Please sign in to comment.
Something went wrong with that request. Please try again.