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:
parent
63639895ad
commit
d1d88c32c3
14
gulpfile.js
14
gulpfile.js
|
@ -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)});
|
||||
|
|
Loading…
Reference in New Issue