BridgeProfiler: add sync Relay methods

Reviewed By: sahrens

Differential Revision: D2721549

fb-gh-sync-id: af6a83f8505a83e323af3992d9552654ea644324
This commit is contained in:
Jan Kassens 2015-12-11 11:38:19 -08:00 committed by facebook-github-bot-4
parent f168fc335e
commit 836ba8fb38

View File

@ -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