You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by GitBox <gi...@apache.org> on 2018/09/26 05:39:45 UTC

[GitHub] YorkShen closed pull request #1583: [WEEX-634][Android] fix old performance record time

YorkShen closed pull request #1583: [WEEX-634][Android] fix old performance record time
URL: https://github.com/apache/incubator-weex/pull/1583
 
 
   

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/common/WXPerformance.java b/android/sdk/src/main/java/com/taobao/weex/common/WXPerformance.java
index 9c83e31705..b70c42f410 100644
--- a/android/sdk/src/main/java/com/taobao/weex/common/WXPerformance.java
+++ b/android/sdk/src/main/java/com/taobao/weex/common/WXPerformance.java
@@ -24,6 +24,7 @@
 import com.taobao.weex.WXSDKInstance;
 import com.taobao.weex.WXSDKManager;
 import com.taobao.weex.performance.WXInstanceApm;
+import com.taobao.weex.utils.WXUtils;
 import com.taobao.weex.utils.WXViewUtils;
 
 import java.util.HashMap;
@@ -166,6 +167,8 @@ public double getMaxRange() {
   @RestrictTo(RestrictTo.Scope.LIBRARY)
   public long renderTimeOrigin;
 
+  public long renderUnixTimeOrigin;
+
   public long fsRenderTime;
 
   public long callCreateFinishTime;
@@ -555,6 +558,7 @@ public void appendErrMsg(CharSequence msg) {
 
   public void beforeInstanceRender(String instanceId) {
     renderTimeOrigin = System.currentTimeMillis();
+    renderUnixTimeOrigin = WXUtils.getFixUnixTime();
   }
 
   public void afterInstanceDestroy(String instanceId) {
diff --git a/android/sdk/src/main/java/com/taobao/weex/performance/WXInstanceApm.java b/android/sdk/src/main/java/com/taobao/weex/performance/WXInstanceApm.java
index b868dc265d..bbb5ba3a0c 100644
--- a/android/sdk/src/main/java/com/taobao/weex/performance/WXInstanceApm.java
+++ b/android/sdk/src/main/java/com/taobao/weex/performance/WXInstanceApm.java
@@ -276,17 +276,17 @@ public void arriveInteraction(WXComponent targetComponent) {
             hasRecordFistInteractionView = true;
         }
 
-        long curTIme = WXUtils.getFixUnixTime();
+        long curTime = WXUtils.getFixUnixTime();
 
         if (BuildConfig.DEBUG){
             Log.d("wxapm", "screenComponent ["+targetComponent.getComponentType()+","+targetComponent.getRef()
-                +"], renderTime:"+ (curTIme -performanceRecord.renderTimeOrigin)
+                +"], renderTime:"+ (curTime -performanceRecord.renderUnixTimeOrigin)
                 +",style:"+targetComponent.getStyles()
                 +",attrs:"+targetComponent.getAttrs());
         }
 
-        performanceRecord.interactionTime = curTIme - performanceRecord.renderTimeOrigin;
-        onStageWithTime(KEY_PAGE_STAGES_INTERACTION,curTIme);
+        performanceRecord.interactionTime = curTime - performanceRecord.renderUnixTimeOrigin;
+        onStageWithTime(KEY_PAGE_STAGES_INTERACTION,curTime);
 
         updateDiffStats(KEY_PAGE_STATS_I_SCREEN_VIEW_COUNT, 1);
         updateMaxStats(KEY_PAGE_STATS_I_ALL_VIEW_COUNT, performanceRecord.localInteractionViewAddCount);


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services