From 836ba8fb38e8da0583ff531818222ddc46503364 Mon Sep 17 00:00:00 2001 From: Jan Kassens Date: Fri, 11 Dec 2015 11:38:19 -0800 Subject: [PATCH] BridgeProfiler: add sync Relay methods Reviewed By: sahrens Differential Revision: D2721549 fb-gh-sync-id: af6a83f8505a83e323af3992d9552654ea644324 --- Libraries/Utilities/Systrace.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Libraries/Utilities/Systrace.js b/Libraries/Utilities/Systrace.js index 826be67a1..ffd58715d 100644 --- a/Libraries/Utilities/Systrace.js +++ b/Libraries/Utilities/Systrace.js @@ -15,7 +15,12 @@ type RelayProfiler = { attachProfileHandler( name: string, handler: (name: string, state?: any) => () => void - ): void + ): void, + + attachAggregateHandler( + name: string, + handler: (name: string, callback: () => void) => void + ): void, }; var GLOBAL = GLOBAL || this; @@ -116,6 +121,12 @@ var Systrace = { Systrace.endAsyncEvent(name, cookie); }; }); + + relayProfiler.attachAggregateHandler('*', (name, callback) => { + Systrace.beginEvent(name); + callback(); + Systrace.endEvent(); + }); }, /* This is not called by default due to perf overhead but it's useful