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.
|
// require cycles inside the factory from causing an infinite require loop.
|
||||||
mod.isInitialized = true;
|
mod.isInitialized = true;
|
||||||
|
|
||||||
__DEV__ && BridgeProfiling().profile('JS_require_' + id);
|
__DEV__ && Systrace().beginEvent('JS_require_' + id);
|
||||||
|
|
||||||
// keep args in sync with with defineModuleCode in
|
// keep args in sync with with defineModuleCode in
|
||||||
// packager/react-packager/src/Resolver/index.js
|
// packager/react-packager/src/Resolver/index.js
|
||||||
mod.factory.call(global, global, require, mod.module, mod.module.exports);
|
mod.factory.call(global, global, require, mod.module, mod.module.exports);
|
||||||
|
|
||||||
__DEV__ && BridgeProfiling().profileEnd();
|
__DEV__ && Systrace().endEvent();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
mod.hasError = true;
|
mod.hasError = true;
|
||||||
mod.isInitialized = false;
|
mod.isInitialized = false;
|
||||||
|
@ -70,14 +70,14 @@
|
||||||
return mod.module.exports;
|
return mod.module.exports;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BridgeProfiling = __DEV__ && (() => {
|
const Systrace = __DEV__ && (() => {
|
||||||
var _BridgeProfiling;
|
var _Systrace;
|
||||||
try {
|
try {
|
||||||
_BridgeProfiling = require('BridgeProfiling');
|
_Systrace = require('Systrace');
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
|
|
||||||
return _BridgeProfiling && _BridgeProfiling.profile ?
|
return _Systrace && _Systrace.beginEvent ?
|
||||||
_BridgeProfiling : { profile: () => {}, profileEnd: () => {} };
|
_Systrace : { beginEvent: () => {}, endEvent: () => {} };
|
||||||
});
|
});
|
||||||
|
|
||||||
global.__d = define;
|
global.__d = define;
|
||||||
|
|
Loading…
Reference in New Issue