log onHostResume and onHostPause times

Reviewed By: alexeylang

Differential Revision: D4640631

fbshipit-source-id: fe55368b152c96ce631280143d59923aa2e628d3
This commit is contained in:
Aaron Chiu 2017-03-02 22:41:19 -08:00 committed by Facebook Github Bot
parent ee122be97e
commit d2050a35dd
2 changed files with 8 additions and 0 deletions

View File

@ -189,6 +189,7 @@ public class ReactContext extends ContextWrapper {
UiThreadUtil.assertOnUiThread();
mLifecycleState = LifecycleState.RESUMED;
mCurrentActivity = new WeakReference(activity);
ReactMarker.logMarker(ReactMarkerConstants.ON_HOST_RESUME_START);
for (LifecycleEventListener listener : mLifecycleEventListeners) {
try {
listener.onHostResume();
@ -196,6 +197,7 @@ public class ReactContext extends ContextWrapper {
handleException(e);
}
}
ReactMarker.logMarker(ReactMarkerConstants.ON_HOST_RESUME_END);
}
public void onNewIntent(@Nullable Activity activity, Intent intent) {
@ -216,6 +218,7 @@ public class ReactContext extends ContextWrapper {
public void onHostPause() {
UiThreadUtil.assertOnUiThread();
mLifecycleState = LifecycleState.BEFORE_RESUME;
ReactMarker.logMarker(ReactMarkerConstants.ON_HOST_PAUSE_START);
for (LifecycleEventListener listener : mLifecycleEventListeners) {
try {
listener.onHostPause();
@ -223,6 +226,7 @@ public class ReactContext extends ContextWrapper {
handleException(e);
}
}
ReactMarker.logMarker(ReactMarkerConstants.ON_HOST_PAUSE_END);
}
/**

View File

@ -62,4 +62,8 @@ public class ReactMarkerConstants {
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";
public static final String ON_HOST_RESUME_START = "ON_HOST_RESUME_START";
public static final String ON_HOST_RESUME_END = "ON_HOST_RESUME_END";
public static final String ON_HOST_PAUSE_START = "ON_HOST_PAUSE_START";
public static final String ON_HOST_PAUSE_END = "ON_HOST_PAUSE_END";
}