From 9fe36beec94f73dcd65aba2ea63dfed800a74663 Mon Sep 17 00:00:00 2001 From: Alexey Lang Date: Fri, 30 Oct 2015 12:03:52 -0700 Subject: [PATCH] Log JSBundleRequireTime and JSAppRequireTime. Reviewed By: javache Differential Revision: D2590707 fb-gh-sync-id: 4c306342b5725aaaac1d8fa0257ef860e446b0d4 --- Libraries/Utilities/PerformanceLogger.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Libraries/Utilities/PerformanceLogger.js b/Libraries/Utilities/PerformanceLogger.js index 37d19c795..75d8478bc 100644 --- a/Libraries/Utilities/PerformanceLogger.js +++ b/Libraries/Utilities/PerformanceLogger.js @@ -71,11 +71,21 @@ var PerformanceLogger = { timespans[key].endTime - timespans[key].startTime; }, - clearTimespans() { + clear() { timespans = {}; extras = {}; }, + clearExceptTimespans(keys) { + timespans = Object.keys(timespans).reduce(function(previous, key) { + if (keys.indexOf(key) !== -1) { + previous[key] = timespans[key]; + } + return previous; + }, {}); + extras = {}; + }, + getTimespans() { return timespans; },