Cleanup markers in getConstants

Summary:
* Only add the moduleName to the outer marker
* Include module init in the marker time
* Include the WritableNativeArray time in CONVERT_CONSTANTS
* Stop all markers from finally block in case of exception

Reviewed By: kathryngray

Differential Revision: D5031411

fbshipit-source-id: bf86ee3d59f2cb38866afd52e84af5699db1a003
This commit is contained in:
Pieter De Baets
2017-05-26 09:23:50 -07:00
committed by Facebook Github Bot
parent 2de2133014
commit e9fc7311c4
2 changed files with 22 additions and 24 deletions

View File

@@ -99,7 +99,7 @@ public class ModuleHolder {
SoftAssertions.assertCondition(mModule == null, "Creating an already created module.");
int instanceKey = sInstanceKeyCounter.getAndIncrement();
ReactMarker.logMarker(CREATE_MODULE_START, mName, instanceKey);
SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "createModule")
SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ModuleHolder.createModule")
.arg("name", mName)
.flush();
NativeModule module;
@@ -118,14 +118,9 @@ public class ModuleHolder {
}
private void doInitialize(NativeModule module) {
SystraceMessage.Builder section =
SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "initialize");
if (module instanceof CxxModuleWrapper) {
section.arg("className", module.getClass().getSimpleName());
} else {
section.arg("name", mName);
}
section.flush();
SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ModuleHolder.initialize")
.arg("name", mName)
.flush();
ReactMarker.logMarker(ReactMarkerConstants.INITIALIZE_MODULE_START, mName);
try {
module.initialize();