mirror of https://github.com/status-im/metro.git
Add file transform event to Activity
Summary: Add a telemetric event to the transformer. Reviewed By: davidaurelio Differential Revision: D3950902 fbshipit-source-id: c46e95ee93925fb0f9d1784aebdc3206baf74dc6
This commit is contained in:
parent
f3f12c6d2d
commit
351d9da0e8
|
@ -8,6 +8,7 @@
|
||||||
*/
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const Activity = require('../Activity');
|
||||||
const Promise = require('promise');
|
const Promise = require('promise');
|
||||||
const declareOpts = require('../lib/declareOpts');
|
const declareOpts = require('../lib/declareOpts');
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
|
@ -90,10 +91,19 @@ class Transformer {
|
||||||
return Promise.reject(new Error('No transform module'));
|
return Promise.reject(new Error('No transform module'));
|
||||||
}
|
}
|
||||||
debug('transforming file', fileName);
|
debug('transforming file', fileName);
|
||||||
|
const transformEventId = Activity.startEvent(
|
||||||
|
'Transforming file',
|
||||||
|
fileName,
|
||||||
|
{
|
||||||
|
telemetric: true,
|
||||||
|
silent: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
return this
|
return this
|
||||||
._transform(this._transformModulePath, fileName, code, options)
|
._transform(this._transformModulePath, fileName, code, options)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
debug('done transforming file', fileName);
|
debug('done transforming file', fileName);
|
||||||
|
Activity.endEvent(transformEventId);
|
||||||
return result;
|
return result;
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
Loading…
Reference in New Issue