Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
Fix crash of accessing apm stage data not in component thread. (#2678)
Browse files Browse the repository at this point in the history
  • Loading branch information
wqyfavor authored and lucky-chen committed Jul 11, 2019
1 parent f6f1127 commit 56444e0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ios/sdk/WeexSDK/Sources/Performance/WXApmForInstance.m
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,14 @@ - (void) endRecord
[self.apmProtocolInstance onEnd];
}

WXLogInfo(@"apm data: %@", self.recordStageMap);
NSNumber* stageRenderOrigin = self.recordStageMap[KEY_PAGE_STAGES_RENDER_ORGIGIN];
NSNumber* stageInteraction = self.recordStageMap[KEY_PAGE_STAGES_INTERACTION];
if (stageRenderOrigin && stageInteraction) {
WXLogInfo(@"apm interaction time(ms): %lld", [stageInteraction longLongValue] - [stageRenderOrigin longLongValue]);
}
WXPerformBlockOnComponentThread(^{
WXLogInfo(@"APM data of instance: %@, %@", self.instanceId, self.recordStageMap);
NSNumber* stageRenderOrigin = self.recordStageMap[KEY_PAGE_STAGES_RENDER_ORGIGIN];
NSNumber* stageInteraction = self.recordStageMap[KEY_PAGE_STAGES_INTERACTION];
if (stageRenderOrigin && stageInteraction) {
WXLogInfo(@"APM interaction time(ms): %lld", [stageInteraction longLongValue] - [stageRenderOrigin longLongValue]);
}
});
}

- (void) updateFSDiffStats:(NSString *)name withDiffValue:(double)diff
Expand Down

0 comments on commit 56444e0

Please sign in to comment.