YorkShen closed pull request #1475: [WEEX-595][Android] fix report empty when
too fast between render(tem…
URL: https://github.com/apache/incubator-weex/pull/1475
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/android/sdk/src/main/java/com/taobao/weex/performance/WXInstanceExceptionRecord.java
b/android/sdk/src/main/java/com/taobao/weex/performance/WXInstanceExceptionRecord.java
index 91d25af8f0..626a520f1d 100644
---
a/android/sdk/src/main/java/com/taobao/weex/performance/WXInstanceExceptionRecord.java
+++
b/android/sdk/src/main/java/com/taobao/weex/performance/WXInstanceExceptionRecord.java
@@ -141,13 +141,26 @@ public void checkEmptyScreenAndReport() {
return;
}
//2s limit of instance stayTime (case in\quit very fast case)
- final long DIFF_LIMIT = 2000;
- long useTime = 2001;
+ final long DIFF_LIMIT_FROM_RENDER_URL = 2000;
+ final long DIFF_LIMIT_FROM_RENDER_TEMPLATE = 1000;
+
+ long curTime = WXUtils.getFixUnixTime();
Long startRequestTime =
mStageMap.get(WXInstanceApm.KEY_PAGE_STAGES_DOWN_BUNDLE_START);
+ long useTime;
+ String useTimeForm;
+ boolean shouldReportByUseTime;
if (null != startRequestTime) {
- useTime = WXUtils.getFixUnixTime() - startRequestTime;
+ useTime = curTime - startRequestTime;
+ shouldReportByUseTime = useTime >= DIFF_LIMIT_FROM_RENDER_URL;
+ useTimeForm = WXInstanceApm.KEY_PAGE_STAGES_DOWN_BUNDLE_START;
+ }else {
+ Long startRenderTemplateTime =
mStageMap.get(WXInstanceApm.KEY_PAGE_STAGES_RENDER_ORGIGIN);
+ useTime = null != startRenderTemplateTime?curTime -
startRenderTemplateTime:curTime;
+ shouldReportByUseTime = useTime >= DIFF_LIMIT_FROM_RENDER_TEMPLATE;
+ useTimeForm = WXInstanceApm.KEY_PAGE_STAGES_RENDER_ORGIGIN;
}
- if (useTime < DIFF_LIMIT) {
+
+ if (!shouldReportByUseTime){
return;
}
@@ -164,6 +177,7 @@ public void checkEmptyScreenAndReport() {
flagMap.put("wxHasDegrade",String.valueOf(hasDegrade.get()));
flagMap.put("wxHasReportScreenEmpty",String.valueOf(mHasReportScreenEmpty));
flagMap.put("wxUseTime", String.valueOf(useTime));
+ flagMap.put("wxUseTimeForm", useTimeForm);
WXExceptionUtils.commitCriticalExceptionRT(
instanceId,
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services