log native module initialization time

Reviewed By: alexeylang

Differential Revision: D4640369

fbshipit-source-id: 9d1ec353d9b8c4bccb5eedea1fc5d0f6cb414985
This commit is contained in:
Aaron Chiu
2017-03-02 15:58:54 -08:00
committed by Facebook Github Bot
parent f9a3ed3793
commit 9f68d95943
2 changed files with 5 additions and 0 deletions

View File

@@ -60,4 +60,6 @@ public class ReactMarkerConstants {
"CREATE_I18N_ASSETS_MODULE_END";
public static final String GET_CONSTANTS_START = "GET_CONSTANTS_START";
public static final String GET_CONSTANTS_END = "GET_CONSTANTS_END";
public static final String INITIALIZE_MODULE_START = "INITIALIZE_MODULE_START";
public static final String INITIALIZE_MODULE_END = "INITIALIZE_MODULE_END";
}

View File

@@ -9,6 +9,7 @@ import java.util.concurrent.ExecutionException;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactMarker;
import com.facebook.react.bridge.ReactMarkerConstants;
import com.facebook.react.common.futures.SimpleSettableFuture;
import com.facebook.systrace.Systrace;
import com.facebook.systrace.SystraceMessage;
@@ -122,7 +123,9 @@ public class ModuleHolder {
section.arg("name", mName);
}
section.flush();
ReactMarker.logMarker(ReactMarkerConstants.INITIALIZE_MODULE_START, mName);
callInitializeOnUiThread(module);
ReactMarker.logMarker(ReactMarkerConstants.INITIALIZE_MODULE_END);
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
}