You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2018/03/29 03:08:30 UTC
incubator-weex git commit: [WEEX-267][ios]monitor the frequency of
module invoke
Repository: incubator-weex
Updated Branches:
refs/heads/master 81c8e4afc -> 9b5f3bea8
[WEEX-267][ios]monitor the frequency of module invoke
Add new optional method for module invoke monitor, do not use alarm anymore.
[WEEX-267][ios]change method signature
close #1090
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9b5f3bea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9b5f3bea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9b5f3bea
Branch: refs/heads/master
Commit: 9b5f3bea83921245a4bf05bbd6fbf3a21b4eb477
Parents: 81c8e4a
Author: CYJB <f8...@126.com>
Authored: Wed Mar 28 19:43:32 2018 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Thu Mar 29 11:08:05 2018 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Bridge/WXModuleMethod.m | 8 +++++++-
ios/sdk/WeexSDK/Sources/Protocol/WXAppMonitorProtocol.h | 4 ++++
2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9b5f3bea/ios/sdk/WeexSDK/Sources/Bridge/WXModuleMethod.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXModuleMethod.m b/ios/sdk/WeexSDK/Sources/Bridge/WXModuleMethod.m
index aae3b6f..8827849 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXModuleMethod.m
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXModuleMethod.m
@@ -113,7 +113,13 @@
- (void)commitModuleInvoke
{
id<WXAppMonitorProtocol> appMonitorHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXAppMonitorProtocol)];
- if ([appMonitorHandler respondsToSelector:@selector(commitAppMonitorAlarm:monitorPoint:success:errorCode:errorMsg:arg:)]) {
+ if ([appMonitorHandler respondsToSelector:@selector(commitMonitorWithPage:monitorPoint:args:)]) {
+ NSDictionary * args = @{
+ @"url": self.instance.pageName ?: @"",
+ @"name": [NSString stringWithFormat:@"%@.%@", self.moduleName, self.methodName],
+ };
+ [appMonitorHandler commitMonitorWithPage:@"weex" monitorPoint:@"invokeModule" args:args];
+ } else if ([appMonitorHandler respondsToSelector:@selector(commitAppMonitorAlarm:monitorPoint:success:errorCode:errorMsg:arg:)]) {
NSString * arg = [NSString stringWithFormat:@"%@.%@", self.moduleName, self.methodName];
[appMonitorHandler commitAppMonitorAlarm:@"weex" monitorPoint:@"invokeModule" success:NO errorCode:@"101" errorMsg:self.instance.pageName arg:arg];
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9b5f3bea/ios/sdk/WeexSDK/Sources/Protocol/WXAppMonitorProtocol.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Protocol/WXAppMonitorProtocol.h b/ios/sdk/WeexSDK/Sources/Protocol/WXAppMonitorProtocol.h
index a75d15f..e2f0465 100644
--- a/ios/sdk/WeexSDK/Sources/Protocol/WXAppMonitorProtocol.h
+++ b/ios/sdk/WeexSDK/Sources/Protocol/WXAppMonitorProtocol.h
@@ -54,4 +54,8 @@
- (void)commitAppMonitorAlarm:(NSString *)pageName monitorPoint:(NSString *)monitorPoint success:(BOOL)success errorCode:(NSString *)errorCode errorMsg:(NSString *)errorMsg arg:(NSString *)arg;
+@optional
+
+- (void)commitMonitorWithPage:(NSString *)pageName monitorPoint:(NSString *)monitorPoint args:(NSDictionary *)args;
+
@end