From 351d9da0e85a6e8fa0f27d0ddbf663a4bbe99b71 Mon Sep 17 00:00:00 2001 From: Ovidiu Viorel Iepure Date: Fri, 30 Sep 2016 08:29:21 -0700 Subject: [PATCH] Add file transform event to Activity Summary: Add a telemetric event to the transformer. Reviewed By: davidaurelio Differential Revision: D3950902 fbshipit-source-id: c46e95ee93925fb0f9d1784aebdc3206baf74dc6 --- react-packager/src/JSTransformer/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/react-packager/src/JSTransformer/index.js b/react-packager/src/JSTransformer/index.js index 681f864a..b0bda78f 100644 --- a/react-packager/src/JSTransformer/index.js +++ b/react-packager/src/JSTransformer/index.js @@ -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 => {