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';
|
||||
|
||||
const Activity = require('../Activity');
|
||||
const Promise = require('promise');
|
||||
const declareOpts = require('../lib/declareOpts');
|
||||
const os = require('os');
|
||||
|
@ -90,10 +91,19 @@ class Transformer {
|
|||
return Promise.reject(new Error('No transform module'));
|
||||
}
|
||||
debug('transforming file', fileName);
|
||||
const transformEventId = Activity.startEvent(
|
||||
'Transforming file',
|
||||
fileName,
|
||||
{
|
||||
telemetric: true,
|
||||
silent: true,
|
||||
},
|
||||
);
|
||||
return this
|
||||
._transform(this._transformModulePath, fileName, code, options)
|
||||
.then(result => {
|
||||
debug('done transforming file', fileName);
|
||||
Activity.endEvent(transformEventId);
|
||||
return result;
|
||||
})
|
||||
.catch(error => {
|
||||
|
|
Loading…
Reference in New Issue