build(analytics): start tracking gulp startup latency

This measures how long does it take for gulp to start the first task up after being invoked from command line.

I'm suspecting that we can optimize this significantly, but let's start tracking it first.
This commit is contained in:
Igor Minar 2015-11-12 23:51:28 -08:00
parent 63639895ad
commit d1d88c32c3
1 changed files with 11 additions and 3 deletions

View File

@ -1282,6 +1282,14 @@ process.on('beforeExit', function() {
});
gulp.on('task_start', (e) => { analytics.buildStart('gulp ' + e.task)});
gulp.on('task_stop', (e) => { analytics.buildSuccess('gulp ' + e.task, e.duration*1000)});
gulp.on('task_err', (e) => { analytics.buildError('gulp ' + e.task, e.duration*1000)});
var firstTask = true;
gulp.on('task_start', (e) => {
if (firstTask) {
firstTask = false;
analytics.buildSuccess('gulp <startup>', process.uptime() * 1000);
}
analytics.buildStart('gulp ' + e.task)
});
gulp.on('task_stop', (e) => {analytics.buildSuccess('gulp ' + e.task, e.duration * 1000)});
gulp.on('task_err', (e) => {analytics.buildError('gulp ' + e.task, e.duration * 1000)});