mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-04 09:27:53 +08:00
add perf markers for reload and download
Reviewed By: alexeylang Differential Revision: D5633613 fbshipit-source-id: 1fe39669cf4ba4e1475bb57de59c696771ebf8c7
This commit is contained in:
committed by
Facebook Github Bot
parent
30d9c3d279
commit
c080fe54d6
@@ -67,4 +67,7 @@ public enum ReactMarkerConstants {
|
||||
ATTACH_MEASURED_ROOT_VIEWS_START,
|
||||
ATTACH_MEASURED_ROOT_VIEWS_END,
|
||||
CONTENT_APPEARED,
|
||||
RELOAD,
|
||||
DOWNLOAD_START,
|
||||
DOWNLOAD_END,
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
package com.facebook.react.devsupport;
|
||||
|
||||
import com.facebook.react.bridge.ReactMarker;
|
||||
import com.facebook.react.bridge.ReactMarkerConstants;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
@@ -639,6 +641,8 @@ public class DevSupportManagerImpl implements
|
||||
public void handleReloadJS() {
|
||||
UiThreadUtil.assertOnUiThread();
|
||||
|
||||
ReactMarker.logMarker(ReactMarkerConstants.RELOAD);
|
||||
|
||||
// dismiss redbox if exists
|
||||
if (mRedBoxDialog != null) {
|
||||
mRedBoxDialog.dismiss();
|
||||
@@ -830,6 +834,8 @@ public class DevSupportManagerImpl implements
|
||||
}
|
||||
|
||||
public void reloadJSFromServer(final String bundleURL) {
|
||||
ReactMarker.logMarker(ReactMarkerConstants.DOWNLOAD_START);
|
||||
|
||||
mDevLoadingViewController.showForUrl(bundleURL);
|
||||
mDevLoadingViewVisible = true;
|
||||
|
||||
@@ -846,6 +852,7 @@ public class DevSupportManagerImpl implements
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ReactMarker.logMarker(ReactMarkerConstants.DOWNLOAD_END);
|
||||
mReactInstanceCommandsHandler.onJSBundleLoadedFromServer();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user