mirror of https://github.com/status-im/metro.git
Rename BridgeProfiling to Systrace for consistency
Summary: public Rename the `BridgeProfiling` JS module to `Systrace`, since it's actually just an API to Systrace markers. This should make it clearer as we add more perf tooling. Reviewed By: jspahrsummers Differential Revision: D2734001 fb-gh-sync-id: 642848fa7340c545067f2a7cf5cef8af1c8a69a2
This commit is contained in:
parent
ff3cac5436
commit
2927b76993
|
@ -54,13 +54,13 @@
|
|||
// require cycles inside the factory from causing an infinite require loop.
|
||||
mod.isInitialized = true;
|
||||
|
||||
__DEV__ && BridgeProfiling().profile('JS_require_' + id);
|
||||
__DEV__ && Systrace().beginEvent('JS_require_' + id);
|
||||
|
||||
// keep args in sync with with defineModuleCode in
|
||||
// packager/react-packager/src/Resolver/index.js
|
||||
mod.factory.call(global, global, require, mod.module, mod.module.exports);
|
||||
|
||||
__DEV__ && BridgeProfiling().profileEnd();
|
||||
__DEV__ && Systrace().endEvent();
|
||||
} catch (e) {
|
||||
mod.hasError = true;
|
||||
mod.isInitialized = false;
|
||||
|
@ -70,14 +70,14 @@
|
|||
return mod.module.exports;
|
||||
}
|
||||
|
||||
const BridgeProfiling = __DEV__ && (() => {
|
||||
var _BridgeProfiling;
|
||||
const Systrace = __DEV__ && (() => {
|
||||
var _Systrace;
|
||||
try {
|
||||
_BridgeProfiling = require('BridgeProfiling');
|
||||
_Systrace = require('Systrace');
|
||||
} catch(e) {}
|
||||
|
||||
return _BridgeProfiling && _BridgeProfiling.profile ?
|
||||
_BridgeProfiling : { profile: () => {}, profileEnd: () => {} };
|
||||
return _Systrace && _Systrace.beginEvent ?
|
||||
_Systrace : { beginEvent: () => {}, endEvent: () => {} };
|
||||
});
|
||||
|
||||
global.__d = define;
|
||||
|
|
Loading…
Reference in New Issue