From a303a42e28a49880d92a4d07dc2ad1ca23bf0aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Bigio?= Date: Mon, 10 Aug 2015 16:00:20 -0700 Subject: [PATCH] [react-packager] Add more granular Activity logging --- .../DependencyResolver/DependencyGraph/index.js | 17 +++++++++++++---- .../src/DependencyResolver/fastfs.js | 3 +++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packager/react-packager/src/DependencyResolver/DependencyGraph/index.js b/packager/react-packager/src/DependencyResolver/DependencyGraph/index.js index e66191e44..7e7185829 100644 --- a/packager/react-packager/src/DependencyResolver/DependencyGraph/index.js +++ b/packager/react-packager/src/DependencyResolver/DependencyGraph/index.js @@ -101,7 +101,7 @@ class DependencyGraph { this._loading = Promise.all([ this._fastfs.build() .then(() => { - const hasteActivity = Activity.startEvent('haste map'); + const hasteActivity = Activity.startEvent('Building Haste Map'); this._buildHasteMap().then(() => Activity.endEvent(hasteActivity)); }), this._buildAssetMap_DEPRECATED(), @@ -518,9 +518,18 @@ class DependencyGraph { fastfs.on('change', this._processAssetChange_DEPRECATED.bind(this)); return fastfs.build().then( - () => fastfs.findFilesByExts(this._opts.assetExts).map( - file => this._processAsset_DEPRECATED(file) - ) + () => { + const processAsset_DEPRECATEDActivity = Activity.startEvent( + 'Building (deprecated) Asset Map', + ); + + const assets = fastfs.findFilesByExts(this._opts.assetExts).map( + file => this._processAsset_DEPRECATED(file) + ); + + Activity.endEvent(processAsset_DEPRECATEDActivity); + return assets; + } ); } diff --git a/packager/react-packager/src/DependencyResolver/fastfs.js b/packager/react-packager/src/DependencyResolver/fastfs.js index 67f7076e1..884296023 100644 --- a/packager/react-packager/src/DependencyResolver/fastfs.js +++ b/packager/react-packager/src/DependencyResolver/fastfs.js @@ -1,5 +1,6 @@ 'use strict'; +const Activity = require('../Activity'); const Promise = require('promise'); const {EventEmitter} = require('events'); @@ -28,6 +29,7 @@ class Fastfs extends EventEmitter { ); return this._crawling.then(files => { + const fastfsActivity = Activity.startEvent('Building in-memory fs'); files.forEach(filePath => { if (filePath.match(rootsPattern)) { const newFile = new File(filePath, { isDir: false }); @@ -44,6 +46,7 @@ class Fastfs extends EventEmitter { } } }); + Activity.endEvent(fastfsActivity); this._fileWatcher.on('all', this._processFileChange.bind(this)); }); }