mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 01:40:08 +00:00
BridgeProfiler: add sync Relay methods
Reviewed By: sahrens Differential Revision: D2721549 fb-gh-sync-id: af6a83f8505a83e323af3992d9552654ea644324
This commit is contained in:
parent
f168fc335e
commit
836ba8fb38
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user