Repository: incubator-weex Updated Branches: refs/heads/master 4876bc4b0 -> 481a998bc (forced update)
[WEEX-305][iOS] support more performance point * [iOS] support more performance point * [iOS] fix compile close #1129 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/481a998b Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/481a998b Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/481a998b Branch: refs/heads/master Commit: 481a998bc81ca78a7d91601519d64809d0ccfdd9 Parents: c31f7d2 Author: zhongcang <qh438406...@gmail.com> Authored: Wed Mar 28 13:25:07 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu Apr 26 14:28:45 2018 +0800 ---------------------------------------------------------------------- .../WeexDemo.xcodeproj/project.pbxproj | 10 +- ios/playground/WeexDemo/AppDelegate.m | 9 + ios/playground/WeexDemo/debug/DebugAnalyzer.h | 24 ++ ios/playground/WeexDemo/debug/DebugAnzlyzer.m | 30 +++ ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 50 +++- .../WeexSDK/Sources/Bridge/WXBridgeContext.m | 19 +- .../Sources/Component/WXImageComponent.m | 10 + ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h | 20 ++ ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m | 106 +++++++++ .../WeexSDK/Sources/Layout/WXComponent+Layout.m | 9 + .../WeexSDK/Sources/Manager/WXBridgeManager.m | 6 + .../Sources/Manager/WXComponentManager.m | 52 +++++ .../WeexSDK/Sources/Manager/WXTracingManager.m | 2 +- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 7 + .../Sources/Model/WXSDKInstance_performance.h | 67 ++++++ .../Sources/Model/WXSDKInstance_performance.m | 35 +++ ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m | 6 + ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m | 6 + .../Sources/Monitor/WXAnalyzerCenter+Transfer.h | 15 ++ .../WeexSDK/Sources/Monitor/WXAnalyzerCenter.h | 16 ++ .../WeexSDK/Sources/Monitor/WXAnalyzerCenter.m | 234 +++++++++++++++++++ .../WeexSDK/Sources/Monitor/WXExceptionUtils.m | 5 + ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.h | 27 +++ ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.m | 75 ++++-- .../Sources/Protocol/WXAnalyzerProtocol.h | 25 ++ .../Sources/Protocol/WXAppMonitorProtocol.h | 19 ++ ios/sdk/WeexSDK/Sources/View/WXRootView.h | 2 + ios/sdk/WeexSDK/Sources/View/WXRootView.m | 17 ++ ios/sdk/WeexSDK/Sources/WeexSDK.h | 2 + 29 files changed, 880 insertions(+), 25 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/playground/WeexDemo.xcodeproj/project.pbxproj ---------------------------------------------------------------------- diff --git a/ios/playground/WeexDemo.xcodeproj/project.pbxproj b/ios/playground/WeexDemo.xcodeproj/project.pbxproj index 674d57d..9721ca7 100644 --- a/ios/playground/WeexDemo.xcodeproj/project.pbxproj +++ b/ios/playground/WeexDemo.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 17C1DB57206B675D000E0CEB /* DebugAnzlyzer.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C1DB56206B675D000E0CEB /* DebugAnzlyzer.m */; }; 2AE88A2C1C8544E6003329DE /* WXScannerVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AE88A2B1C8544E6003329DE /* WXScannerVC.m */; }; 564B94671DD9C65000441C8D /* WeexUITestDemo-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 564B94661DD9C65000441C8D /* WeexUITestDemo-Info.plist */; }; 59EA0DA71D2E7D19004F904A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 59EA0DA61D2E7D19004F904A /* Images.xcassets */; }; @@ -66,6 +67,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 17C1DB55206B6729000E0CEB /* DebugAnalyzer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DebugAnalyzer.h; path = debug/DebugAnalyzer.h; sourceTree = "<group>"; }; + 17C1DB56206B675D000E0CEB /* DebugAnzlyzer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = DebugAnzlyzer.m; path = debug/DebugAnzlyzer.m; sourceTree = "<group>"; }; 1888E2C5769382461DEDC97D /* Pods-WeexUITestDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeexUITestDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-WeexUITestDemo/Pods-WeexUITestDemo.release.xcconfig"; sourceTree = "<group>"; }; 2278B1B1FCE894EDAF9F0171 /* Pods-WeexUITestDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeexUITestDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-WeexUITestDemo/Pods-WeexUITestDemo.debug.xcconfig"; sourceTree = "<group>"; }; 22E4D2883CC56188A2CA9C13 /* Pods-WeexDemo.uitest.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeexDemo.uitest.xcconfig"; path = "Pods/Target Support Files/Pods-WeexDemo/Pods-WeexDemo.uitest.xcconfig"; sourceTree = "<group>"; }; @@ -293,6 +296,8 @@ DCABAFF01D029685001C8592 /* WXATLoggerPlugin.m */, DCABAFF11D029685001C8592 /* WXATViewHierarchyPlugin.h */, DCABAFF21D029685001C8592 /* WXATViewHierarchyPlugin.m */, + 17C1DB55206B6729000E0CEB /* DebugAnalyzer.h */, + 17C1DB56206B675D000E0CEB /* DebugAnzlyzer.m */, ); name = debug; sourceTree = "<group>"; @@ -521,7 +526,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; 84361D6F1CA10F8E00F43825 /* [CP] Copy Pods Resources */ = { @@ -580,7 +585,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; C715566148067A7FFAB7797D /* [CP] Copy Pods Resources */ = { @@ -616,6 +621,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 17C1DB57206B675D000E0CEB /* DebugAnzlyzer.m in Sources */, DCABAFF31D029685001C8592 /* WXATLoggerPlugin.m in Sources */, DC15A3D0200E30FC009C8977 /* WXNavigationHandlerImpl.m in Sources */, 2AE88A2C1C8544E6003329DE /* WXScannerVC.m in Sources */, http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/playground/WeexDemo/AppDelegate.m ---------------------------------------------------------------------- diff --git a/ios/playground/WeexDemo/AppDelegate.m b/ios/playground/WeexDemo/AppDelegate.m index 3bf6c31..7687f47 100644 --- a/ios/playground/WeexDemo/AppDelegate.m +++ b/ios/playground/WeexDemo/AppDelegate.m @@ -36,6 +36,12 @@ #import "WXConfigCenterProtocol.h" #import "WXConfigCenterDefaultImpl.h" #import "WXNavigationHandlerImpl.h" +//#import "WXAnalyzerCenter.h" + + +#ifdef DEBUG +#import "DebugAnalyzer.h" +#endif @interface AppDelegate () @end @@ -124,6 +130,9 @@ [WXSDKEngine registerModule:@"titleBar" withClass:NSClassFromString(@"WXTitleBarModule")]; [WXSDKEngine registerExtendCallNative:@"test" withClass:NSClassFromString(@"WXExtendCallNativeTest")]; [WXSDKEngine registerModule:@"ext" withClass:[WXExtModule class]]; +#ifdef DEBUG + [WXAnalyzerCenter addWxAnalyzer:[DebugAnalyzer new]]; +#endif #if !(TARGET_IPHONE_SIMULATOR) [self checkUpdate]; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/playground/WeexDemo/debug/DebugAnalyzer.h ---------------------------------------------------------------------- diff --git a/ios/playground/WeexDemo/debug/DebugAnalyzer.h b/ios/playground/WeexDemo/debug/DebugAnalyzer.h new file mode 100644 index 0000000..99838d0 --- /dev/null +++ b/ios/playground/WeexDemo/debug/DebugAnalyzer.h @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import <WeexSDK/WeexSDK.h> + + +@interface DebugAnalyzer :NSObject<WXAnalyzerProtocol> +@end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/playground/WeexDemo/debug/DebugAnzlyzer.m ---------------------------------------------------------------------- diff --git a/ios/playground/WeexDemo/debug/DebugAnzlyzer.m b/ios/playground/WeexDemo/debug/DebugAnzlyzer.m new file mode 100644 index 0000000..0a84bb8 --- /dev/null +++ b/ios/playground/WeexDemo/debug/DebugAnzlyzer.m @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import <Foundation/Foundation.h> +#import <WeexSDK/WeexSDK.h> +#import "DebugAnalyzer.h" + + +@implementation DebugAnalyzer +- (void)transfer:(NSDictionary *) value +{ + NSLog(@"DebugAnalyzer value : %@",value); +} +@end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj index e698847..a4c0db2 100644 --- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj +++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj @@ -8,6 +8,19 @@ /* Begin PBXBuildFile section */ 042013AD1E66CD6A001FC79C /* WXValidateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 042013AC1E66CD6A001FC79C /* WXValidateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 170B4664208733AF00562666 /* WXAnalyzerCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C74F092072145000AB4CAB /* WXAnalyzerCenter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 170B4665208733BF00562666 /* WXAnalyzerCenter+Transfer.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C74F082072145000AB4CAB /* WXAnalyzerCenter+Transfer.h */; }; + 170B4668208733E500562666 /* WXAnalyzerCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C74F0A2072145100AB4CAB /* WXAnalyzerCenter.m */; }; + 17B122212090AA9300387E33 /* WXSDKInstance_performance.m in Sources */ = {isa = PBXBuildFile; fileRef = 17B1221F2090AA9300387E33 /* WXSDKInstance_performance.m */; }; + 17B122222090AA9300387E33 /* WXSDKInstance_performance.h in Headers */ = {isa = PBXBuildFile; fileRef = 17B122202090AA9300387E33 /* WXSDKInstance_performance.h */; }; + 17B122252090AAB000387E33 /* WXSDKError.h in Headers */ = {isa = PBXBuildFile; fileRef = 17B122232090AAB000387E33 /* WXSDKError.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 17B122262090AAB000387E33 /* WXSDKError.m in Sources */ = {isa = PBXBuildFile; fileRef = 17B122242090AAB000387E33 /* WXSDKError.m */; }; + 17B122272090ABAC00387E33 /* WXSDKError.h in Headers */ = {isa = PBXBuildFile; fileRef = 17B122232090AAB000387E33 /* WXSDKError.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 17C74F0B2072145100AB4CAB /* WXAnalyzerCenter+Transfer.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C74F082072145000AB4CAB /* WXAnalyzerCenter+Transfer.h */; }; + 17C74F0C2072145100AB4CAB /* WXAnalyzerCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C74F092072145000AB4CAB /* WXAnalyzerCenter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 17C74F0D2072145100AB4CAB /* WXAnalyzerCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C74F0A2072145100AB4CAB /* WXAnalyzerCenter.m */; }; + 17C74F0F2072147B00AB4CAB /* WXAnalyzerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C74F0E2072147A00AB4CAB /* WXAnalyzerProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 17F2D6E72087227300084378 /* WXAnalyzerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C74F0E2072147A00AB4CAB /* WXAnalyzerProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1C1A2BED1D91172800539AA1 /* WXConvertTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1A2BEC1D91172800539AA1 /* WXConvertTests.m */; }; 1D3000F11D40B9AC004F3B4F /* WXClipboardModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D3000EF1D40B9AB004F3B4F /* WXClipboardModule.h */; }; 1D3000F21D40B9AC004F3B4F /* WXClipboardModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3000F01D40B9AB004F3B4F /* WXClipboardModule.m */; }; @@ -28,7 +41,6 @@ 2A8E658B1C7C7AA20025C7B7 /* WXVideoComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A8E65891C7C7AA20025C7B7 /* WXVideoComponent.m */; }; 2A919DA61E321F1F006EB6B5 /* WXBridgeMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A919DA41E321F1F006EB6B5 /* WXBridgeMethod.h */; }; 2A919DA71E321F1F006EB6B5 /* WXBridgeMethod.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A919DA51E321F1F006EB6B5 /* WXBridgeMethod.m */; }; - 2AAFC1B61C48DFF70026D2FE /* WXSDKError.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AAFC1B41C48DFF70026D2FE /* WXSDKError.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2AC750241C7565690041D390 /* WXIndicatorComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC750221C7565690041D390 /* WXIndicatorComponent.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2AC750251C7565690041D390 /* WXIndicatorComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AC750231C7565690041D390 /* WXIndicatorComponent.m */; }; 2AE5B7521CAB7DBD0082FDDB /* WXAComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AE5B7501CAB7DBD0082FDDB /* WXAComponent.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -445,7 +457,6 @@ DCA445A21EFA570100D0CFA8 /* WXScrollerComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 77E65A171C155F25008B8775 /* WXScrollerComponent.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445A31EFA570800D0CFA8 /* WXSDKManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D161261C02DE1A0010B15B /* WXSDKManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445A41EFA570E00D0CFA8 /* WXSDKInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D161221C02DDD10010B15B /* WXSDKInstance.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DCA445A51EFA571600D0CFA8 /* WXSDKError.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AAFC1B41C48DFF70026D2FE /* WXSDKError.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445A61EFA571E00D0CFA8 /* WXSDKEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D1611E1C02DDB40010B15B /* WXSDKEngine.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445A71EFA572300D0CFA8 /* WXRootViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A5962D1CB632050012CD52 /* WXRootViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445A81EFA572B00D0CFA8 /* WXResourceResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 742AD72A1DF98C45007DC46C /* WXResourceResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -622,6 +633,14 @@ /* Begin PBXFileReference section */ 042013AC1E66CD6A001FC79C /* WXValidateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXValidateProtocol.h; sourceTree = "<group>"; }; + 17B1221F2090AA9300387E33 /* WXSDKInstance_performance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXSDKInstance_performance.m; sourceTree = "<group>"; }; + 17B122202090AA9300387E33 /* WXSDKInstance_performance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXSDKInstance_performance.h; sourceTree = "<group>"; }; + 17B122232090AAB000387E33 /* WXSDKError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXSDKError.h; sourceTree = "<group>"; }; + 17B122242090AAB000387E33 /* WXSDKError.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXSDKError.m; sourceTree = "<group>"; }; + 17C74F082072145000AB4CAB /* WXAnalyzerCenter+Transfer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WXAnalyzerCenter+Transfer.h"; sourceTree = "<group>"; }; + 17C74F092072145000AB4CAB /* WXAnalyzerCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXAnalyzerCenter.h; sourceTree = "<group>"; }; + 17C74F0A2072145100AB4CAB /* WXAnalyzerCenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXAnalyzerCenter.m; sourceTree = "<group>"; }; + 17C74F0E2072147A00AB4CAB /* WXAnalyzerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXAnalyzerProtocol.h; sourceTree = "<group>"; }; 1C1A2BEC1D91172800539AA1 /* WXConvertTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXConvertTests.m; sourceTree = "<group>"; }; 1D3000EF1D40B9AB004F3B4F /* WXClipboardModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXClipboardModule.h; sourceTree = "<group>"; }; 1D3000F01D40B9AB004F3B4F /* WXClipboardModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXClipboardModule.m; sourceTree = "<group>"; }; @@ -643,7 +662,6 @@ 2A8E65891C7C7AA20025C7B7 /* WXVideoComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXVideoComponent.m; sourceTree = "<group>"; }; 2A919DA41E321F1F006EB6B5 /* WXBridgeMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXBridgeMethod.h; sourceTree = "<group>"; }; 2A919DA51E321F1F006EB6B5 /* WXBridgeMethod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXBridgeMethod.m; sourceTree = "<group>"; }; - 2AAFC1B41C48DFF70026D2FE /* WXSDKError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WXSDKError.h; path = ../Engine/WXSDKError.h; sourceTree = "<group>"; }; 2AC750221C7565690041D390 /* WXIndicatorComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXIndicatorComponent.h; sourceTree = "<group>"; }; 2AC750231C7565690041D390 /* WXIndicatorComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXIndicatorComponent.m; sourceTree = "<group>"; }; 2AE5B7501CAB7DBD0082FDDB /* WXAComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXAComponent.h; sourceTree = "<group>"; }; @@ -1103,7 +1121,9 @@ 749DC2781D408265009E1C91 /* Monitor */ = { isa = PBXGroup; children = ( - 2AAFC1B41C48DFF70026D2FE /* WXSDKError.h */, + 17C74F092072145000AB4CAB /* WXAnalyzerCenter.h */, + 17C74F0A2072145100AB4CAB /* WXAnalyzerCenter.m */, + 17C74F082072145000AB4CAB /* WXAnalyzerCenter+Transfer.h */, 749DC2791D40827B009E1C91 /* WXMonitor.h */, 749DC27A1D40827B009E1C91 /* WXMonitor.m */, 841CD1041F97399C0081196D /* WXExceptionUtils.h */, @@ -1345,10 +1365,12 @@ 77D1611B1C02DD3C0010B15B /* Model */ = { isa = PBXGroup; children = ( + 17B122202090AA9300387E33 /* WXSDKInstance_performance.h */, + 17B1221F2090AA9300387E33 /* WXSDKInstance_performance.m */, + 77D161221C02DDD10010B15B /* WXSDKInstance.h */, 59A5961A1CB630F10012CD52 /* WXComponent+Navigation.h */, 59A5961B1CB630F10012CD52 /* WXComponent+Navigation.m */, 748B25161C44A6F9005D491E /* WXSDKInstance_private.h */, - 77D161221C02DDD10010B15B /* WXSDKInstance.h */, 77D161231C02DDD10010B15B /* WXSDKInstance.m */, DCF343651E49CAEE00A2FB34 /* WXJSExceptionInfo.h */, DCF343661E49CAEE00A2FB34 /* WXJSExceptionInfo.m */, @@ -1359,6 +1381,7 @@ 77D1611C1C02DD3C0010B15B /* Protocol */ = { isa = PBXGroup; children = ( + 17C74F0E2072147A00AB4CAB /* WXAnalyzerProtocol.h */, 59A596171CB630E50012CD52 /* WXNavigationProtocol.h */, DCDFED001E68238F00C228D7 /* WXJSExceptionProtocol.h */, 2AE5B7551CABA04E0082FDDB /* WXEventModuleProtocol.h */, @@ -1381,6 +1404,8 @@ 77D1611D1C02DDA40010B15B /* Engine */ = { isa = PBXGroup; children = ( + 17B122232090AAB000387E33 /* WXSDKError.h */, + 17B122242090AAB000387E33 /* WXSDKError.m */, 77D1611E1C02DDB40010B15B /* WXSDKEngine.h */, 77D1611F1C02DDB40010B15B /* WXSDKEngine.m */, ); @@ -1593,6 +1618,7 @@ 74CFDD3D1F459400007A1A66 /* WXRecycleListDataManager.h in Headers */, 77D161201C02DDB40010B15B /* WXSDKEngine.h in Headers */, 745ED2DA1C5F2C7E002DB5A8 /* WXView.h in Headers */, + 17B122252090AAB000387E33 /* WXSDKError.h in Headers */, 59D3CA411CF9ED57008835DC /* Layout.h in Headers */, 2AE5B7521CAB7DBD0082FDDB /* WXAComponent.h in Headers */, 77D1614F1C02E3880010B15B /* WXUtility.h in Headers */, @@ -1606,6 +1632,7 @@ 74CFDD411F45941E007A1A66 /* WXRecycleListTemplateManager.h in Headers */, 1D3000F11D40B9AC004F3B4F /* WXClipboardModule.h in Headers */, 59A583081CF5B2FD0081FD3E /* WXNavigationDefaultImpl.h in Headers */, + 17B122222090AA9300387E33 /* WXSDKInstance_performance.h in Headers */, 775BEE4E1C16F993008D1629 /* WXDefine.h in Headers */, 77D161241C02DDD10010B15B /* WXSDKInstance.h in Headers */, DC6836E61EBB12B200AD2D84 /* WXConfigCenterProtocol.h in Headers */, @@ -1619,6 +1646,7 @@ 2AE5B7561CABA04E0082FDDB /* WXEventModuleProtocol.h in Headers */, C4C30DE91E1B833D00786B6C /* WXComponent+PseudoClassManagement.h in Headers */, 591DD3321D23AD5800BE8709 /* WXErrorView.h in Headers */, + 17C74F0B2072145100AB4CAB /* WXAnalyzerCenter+Transfer.h in Headers */, D362F94F1C83EDA20003F546 /* WXWebViewModule.h in Headers */, C4F012861E150307003378D0 /* WXWebSocketLoader.h in Headers */, C4E97D331F1EF46D00ABC314 /* WXTracingManager.h in Headers */, @@ -1656,6 +1684,7 @@ 74A4BA9A1CB3BAA100195969 /* WXThreadSafeMutableDictionary.h in Headers */, 74A4BA9E1CB3C0A100195969 /* WXHandlerFactory.h in Headers */, 741DFE021DDD7D18009B020F /* WXRoundedRect.h in Headers */, + 17C74F0F2072147B00AB4CAB /* WXAnalyzerProtocol.h in Headers */, 7423899B1C3174EB00D748CA /* WXWeakObjectWrapper.h in Headers */, 74BF19F81F5139BB00AEE3D7 /* WXJSASTParser.h in Headers */, 59A596191CB630E50012CD52 /* WXNavigationProtocol.h in Headers */, @@ -1691,6 +1720,7 @@ 59A582D41CF481110081FD3E /* WXAppMonitorProtocol.h in Headers */, 2A837AB61CD9DE9200AEDF03 /* WXRefreshComponent.h in Headers */, C43C03E81EC8ACA40044C7FF /* WXPrerenderManager.h in Headers */, + 17C74F0C2072145100AB4CAB /* WXAnalyzerCenter.h in Headers */, 74B232D21D2A2BA4006322EA /* WXLayoutDefine.h in Headers */, C4B834281DE69B09007AD27E /* WXPickerModule.h in Headers */, 59A596311CB632050012CD52 /* WXRootViewController.h in Headers */, @@ -1719,7 +1749,6 @@ 77D1613C1C02DEA60010B15B /* WXJSCoreBridge.h in Headers */, 74D205201E091B8000128F44 /* WXCallJSMethod.h in Headers */, 741DFE061DDD9B30009B020F /* UIBezierPath+Weex.h in Headers */, - 2AAFC1B61C48DFF70026D2FE /* WXSDKError.h in Headers */, BA5F00F11FC5AFFE00F76B5C /* WXLocaleModule.h in Headers */, 742AD72E1DF98C45007DC46C /* WXResourceRequest.h in Headers */, D317338C1C57257000BB7539 /* WXTransform.h in Headers */, @@ -1749,10 +1778,10 @@ DCA445BE1EFA57BB00D0CFA8 /* WXComponentManager.h in Headers */, DCA4459E1EFA56E500D0CFA8 /* WXUtility.h in Headers */, DCA445B91EFA579D00D0CFA8 /* WXErrorView.h in Headers */, + 170B4665208733BF00562666 /* WXAnalyzerCenter+Transfer.h in Headers */, DCA445A01EFA56F400D0CFA8 /* WXType.h in Headers */, DCA445B21EFA576D00D0CFA8 /* WXListComponent.h in Headers */, 333D9A281F41507A007CED39 /* WXTransition.h in Headers */, - DCA445A51EFA571600D0CFA8 /* WXSDKError.h in Headers */, DCA445AD1EFA575100D0CFA8 /* WXNavigationProtocol.h in Headers */, DCA445B01EFA576200D0CFA8 /* WXModalUIModule.h in Headers */, DCA445A61EFA571E00D0CFA8 /* WXSDKEngine.h in Headers */, @@ -1792,6 +1821,7 @@ DCA445A11EFA56FA00D0CFA8 /* WXScrollerProtocol.h in Headers */, DCA445DE1EFA59B800D0CFA8 /* WXSectionDataController.h in Headers */, DCA445F01EFA5A1D00D0CFA8 /* WXComponent_internal.h in Headers */, + 170B4664208733AF00562666 /* WXAnalyzerCenter.h in Headers */, 74B81AE71F73C3E900D3A61D /* WXRecycleListTemplateManager.h in Headers */, DCA445ED1EFA5A1200D0CFA8 /* WXTransform.h in Headers */, DCA445DB1EFA59AA00D0CFA8 /* WXRecyclerComponent.h in Headers */, @@ -1819,6 +1849,8 @@ DCA446101EFA5A8500D0CFA8 /* WXBridgeMethod.h in Headers */, DCA446171EFA5A9900D0CFA8 /* WXPolyfillSet.h in Headers */, DCA446291EFA688B00D0CFA8 /* WeexSDK.h in Headers */, + 17B122272090ABAC00387E33 /* WXSDKError.h in Headers */, + 17F2D6E72087227300084378 /* WXAnalyzerProtocol.h in Headers */, DC7764961F3C685600B5727E /* WXRecyclerDragController.h in Headers */, DCA446161EFA5A9600D0CFA8 /* WXJSCoreBridge.h in Headers */, DCA445F51EFA5A2A00D0CFA8 /* WXURLRewriteDefaultImpl.h in Headers */, @@ -2167,6 +2199,7 @@ 594C28921CF9E61A009793A4 /* WXAnimationModule.m in Sources */, 59A5961D1CB630F10012CD52 /* WXComponent+Navigation.m in Sources */, 77D161631C02ED790010B15B /* WXLog.m in Sources */, + 17C74F0D2072145100AB4CAB /* WXAnalyzerCenter.m in Sources */, 744BEA5A1D0520F300452B5D /* WXComponent+Layout.m in Sources */, 59A582FD1CF5B17B0081FD3E /* WXBridgeContext.m in Sources */, 743933B51C7ED9AA00773BB7 /* WXSimulatorShortcutManager.m in Sources */, @@ -2204,6 +2237,7 @@ DC7764931F3C2CA300B5727E /* WXRecyclerDragController.m in Sources */, 744D61151E4AF23E00B624B3 /* WXDiffUtil.m in Sources */, 74EF31AE1DE58BE200667A07 /* WXURLRewriteDefaultImpl.m in Sources */, + 17B122262090AAB000387E33 /* WXSDKError.m in Sources */, C4B3D6D51E6954300013F38D /* WXEditComponent.m in Sources */, C4C30DE81E1B833D00786B6C /* WXComponent+PseudoClassManagement.m in Sources */, 74915F481C8EB02B00BEBCC0 /* WXAssert.m in Sources */, @@ -2241,6 +2275,7 @@ 77D161211C02DDB40010B15B /* WXSDKEngine.m in Sources */, D33451091D3E19480083598A /* WXCanvasComponent.m in Sources */, 74A4BA971CB365D100195969 /* WXAppConfiguration.m in Sources */, + 17B122212090AA9300387E33 /* WXSDKInstance_performance.m in Sources */, 59A583091CF5B2FD0081FD3E /* WXNavigationDefaultImpl.m in Sources */, 746B923C1F46BE36009AE86B /* WXCellSlotComponent.m in Sources */, 7463192A1C71B92600EFEBD4 /* WXModalUIModule.m in Sources */, @@ -2341,6 +2376,7 @@ DCA4456E1EFA55B300D0CFA8 /* WXModalUIModule.m in Sources */, DCA4456F1EFA55B300D0CFA8 /* WXWebViewModule.m in Sources */, DCA445701EFA55B300D0CFA8 /* WXCanvasModule.m in Sources */, + 170B4668208733E500562666 /* WXAnalyzerCenter.m in Sources */, DCA445711EFA55B300D0CFA8 /* WXMetaModule.m in Sources */, DCA445721EFA55B300D0CFA8 /* WXBoxShadow.m in Sources */, DCA445731EFA55B300D0CFA8 /* NSTimer+Weex.m in Sources */, http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m index 6e48a99..d545d96 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m @@ -46,6 +46,7 @@ #import "WXMonitor.h" #import "WXAppMonitorProtocol.h" #import "WXConfigCenterProtocol.h" +#import "WXSDKInstance_performance.h" #define SuppressPerformSelectorLeakWarning(Stuff) \ do { \ @@ -417,6 +418,9 @@ _Pragma("clang diagnostic pop") \ WXLogInfo(@"instance already destroyed, task ignored"); return -1; } + + NSTimeInterval startTime = CACurrentMediaTime()*1000; + for (NSDictionary *task in tasks) { NSString *methodName = task[@"method"]; NSArray *arguments = task[@"args"]; @@ -435,7 +439,11 @@ _Pragma("clang diagnostic pop") \ } [self performSelector:@selector(_sendQueueLoop) withObject:nil]; - + if (!instance.isJSCreateFinish) { + NSTimeInterval diff = CACurrentMediaTime()*1000-startTime; + instance.performance.fsCallNativeNum++; + instance.performance.fsCallNativeTime = instance.performance.fsCallNativeTime + diff; + } return 1; } @@ -856,11 +864,20 @@ _Pragma("clang diagnostic pop") \ if ([tasks count] > 0 && execIns) { WXSDKInstance * execInstance = [WXSDKManager instanceForID:execIns]; + NSTimeInterval start = -1; + if (execInstance && !(execInstance.isJSCreateFinish)) { + start = CACurrentMediaTime()*1000; + } if (execInstance.instanceJavaScriptContext && execInstance.bundleType) { [self callJSMethod:@"__WEEX_CALL_JAVASCRIPT__" args:@[execIns, tasks] onContext:execInstance.instanceJavaScriptContext completion:nil]; } else { [self callJSMethod:@"callJS" args:@[execIns, tasks]]; } + if (execInstance && !(execInstance.isJSCreateFinish)) { + NSTimeInterval diff = CACurrentMediaTime()*1000 - start; + execInstance.performance.fsCallJsNum++; + execInstance.performance.fsCallJsTime = execInstance.performance.fsCallJsTime+ diff; + } } if (hasTask) { http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m index 6d602be..c3dbcc2 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m @@ -33,6 +33,8 @@ #import "WXConfigCenterProtocol.h" #import "WXSDKEngine.h" #import <pthread/pthread.h> +#import "WXMonitor.h" +#import "WXSDKInstance_performance.h" @interface WXImageView : UIImageView @@ -401,6 +403,14 @@ WX_EXPORT_METHOD(@selector(save:)) } [strongSelf fireEvent:@"load" params:@{ @"success": error? @false : @true,@"size":sizeDict}]; } + //check view/img size + if (!error && image && weakSelf.view) { + double imageSize = image.size.width * image.scale * image.size.height * image.scale; + double viewSize = weakSelf.view.frame.size.height * weakSelf.view.frame.size.width; + if (imageSize > viewSize) { + self.weexInstance.performance.imgWrongSizeNum++; + } + } }]; } else { dispatch_async(WXImageUpdateQueue, ^{ http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h index c272982..718c29a 100644 --- a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h +++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h @@ -69,3 +69,23 @@ typedef NS_ENUM(int, WXSDKErrCode) WX_KEY_EXCEPTION_ABILITY_DOWN_ = -9603, }; +typedef NS_ENUM (int,WXSDKErrorType) +{ + JS_ERROR, + NATIVE_ERROR, + RENDER_ERROR, + DEGRAD_ERROR +}; + +typedef NS_ENUM (int,WXSDKErrorGroup){ + JS, + NATIVE +}; + +@interface WXSDKErrCodeUtil :NSObject + ++ (WXSDKErrorType) getErrorTypeByCode:(WXSDKErrCode) code; ++ (WXSDKErrorGroup) getErrorGroupByCode:(WXSDKErrCode) code; + +@end + http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m new file mode 100644 index 0000000..2340186 --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.m @@ -0,0 +1,106 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import <Foundation/Foundation.h> +#import "WXSDKError.h" + +#define ERROR_TYPE @"type" +#define ERROR_GROUP @"groupe" + +@implementation WXSDKErrCodeUtil + ++(WXSDKErrorType)getErrorTypeByCode:(WXSDKErrCode)code +{ + NSDictionary* codeMap = [[self getMap] objectForKey:@(code)]; + if (!codeMap) { + return NATIVE_ERROR; + } + return [[codeMap objectForKey:ERROR_TYPE] intValue]; +} + + ++(WXSDKErrorGroup) getErrorGroupByCode:(WXSDKErrCode)code +{ + NSDictionary* codeMap = [[self getMap] objectForKey:@(code)]; + if (!codeMap) { + return NATIVE; + } + return [[codeMap objectForKey:ERROR_GROUP] intValue]; +} + ++(NSDictionary *) getMap +{ + static NSDictionary *codeMap; + static dispatch_once_t onceToken; + + dispatch_once(&onceToken, ^{ + + codeMap=@{ + @(WX_ERR_JSFRAMEWORK_START):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_JSFRAMEWORK_LOAD):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_JSFRAMEWORK_EXECUTE):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_JSFRAMEWORK_END):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + + @(WX_ERR_JSBRIDGE_START):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_RENDER_CREATEBODY):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_INVOKE_NATIVE):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_JS_EXECUTE):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_JSBRIDGE_END):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + + @(WX_ERR_RENDER_START):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_JSFRAMEWORK_START):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_RENDER_UPDATTR):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_RENDER_UPDSTYLE):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_RENDER_ADDELEMENT):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_RENDER_REMOVEELEMENT):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_RENDER_MOVEELEMENT):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_RENDER_ADDEVENT):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_RENDER_REMOVEEVENT):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_RENDER_SCROLLTOELEMENT):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_RENDER_END):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + + @(WX_ERR_DOWNLOAD_START):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_JSBUNDLE_DOWNLOAD):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_JSBUNDLE_STRING_CONVERT):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_NOT_CONNECTED_TO_INTERNET):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_CANCEL):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_DOWNLOAD_END):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + + @(WX_KEY_EXCEPTION_SDK_INIT):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_KEY_EXCEPTION_INVOKE):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_KEY_EXCEPTION_JS_DOWNLOAD):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_KEY_EXCEPTION_DOM):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_KEY_EXCEPTION_WXBRIDGE):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + + @(WX_KEY_EXCEPTION_DEGRADE):@{ERROR_TYPE:@(DEGRAD_ERROR),ERROR_GROUP:@(JS)}, + @(WX_KEY_EXCEPTION_DEGRADE_CHECK_CONTENT_LENGTH_FAILED):@{ERROR_TYPE:@(DEGRAD_ERROR),ERROR_GROUP:@(JS)}, + @(WX_KEY_EXCEPTION_DEGRADE_BUNDLE_CONTENTTYPE_ERROR):@{ERROR_TYPE:@(DEGRAD_ERROR),ERROR_GROUP:@(JS)}, + @(WX_KEY_EXCEPTION_DEGRADE_OTHER_CAUSE):@{ERROR_TYPE:@(DEGRAD_ERROR),ERROR_GROUP:@(JS)}, + + @(WX_KEY_EXCEPTION_ABILITY_DOWN):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_KEY_EXCEPTION_ABILITY_DOWN_IMAGE):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_KEY_EXCEPTION_ABILITY_DOWN_TOH5):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_ERR_JSFRAMEWORK_START):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)}, + @(WX_KEY_EXCEPTION_ABILITY_DOWN_):@{ERROR_TYPE:@(JS_ERROR),ERROR_GROUP:@(JS)} + }; + }); + return codeMap; +} + +@end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m index aac8566..b3907af 100644 --- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m +++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m @@ -26,6 +26,8 @@ #import "WXSDKInstance_private.h" #import "WXComponent+BoxShadow.h" #import "WXLayoutDefine.h" +#import "WXMonitor.h" +#import "WXSDKInstance_performance.h" @implementation WXComponent (Layout) @@ -134,6 +136,13 @@ - (void)_frameDidCalculated:(BOOL)isChanged { WXAssertComponentThread(); + if (isChanged) { + CGFloat mainScreenWidth = [[UIScreen mainScreen] bounds].size.width; + CGFloat mainScreenHeight = [[UIScreen mainScreen] bounds].size.height; + if (mainScreenHeight/2 < _calculatedFrame.size.height && mainScreenWidth/2 < _calculatedFrame.size.width) { + [self weexInstance].performance.cellExceedNum++; + } + } if ([self isViewLoaded] && isChanged && [self isViewFrameSyncWithCalculated]) { http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m index 64d901d..3a9e27e 100644 --- a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m +++ b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m @@ -29,6 +29,8 @@ #import "WXDebugTool.h" #import "WXTracingManager.h" #import "WXBridgeContext.h" +#import "WXMonitor.h" +#import "WXSDKInstance_performance.h" @interface WXBridgeManager () @@ -345,6 +347,10 @@ void WXPerformBlockSyncOnBridgeThread(void (^block) (void)) } WXSDKInstance *instance = [WXSDKManager instanceForID:instanceId]; + if(instance && !instance.isJSCreateFinish) + { + instance.performance.fsCallEventNum++; + } WXCallJSMethod *method = [[WXCallJSMethod alloc] initWithModuleName:nil methodName:@"fireEvent" arguments:args instance:instance]; [self callJsMethod:method]; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m index 1413402..175aeb7 100644 --- a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m +++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m @@ -37,6 +37,8 @@ #import "WXPrerenderManager.h" #import "WXTracingManager.h" #import "WXLayoutDefine.h" +#import "WXSDKInstance_performance.h" +#import "WXRootView.h" static NSThread *WXComponentThread; @@ -284,12 +286,16 @@ static css_node_t * rootNodeGetChild(void *context, int i) component->_lazyCreateView = YES; } + [self recordMaximumVirtualDom:component]; + if (!component->_isTemplate) { __weak typeof(self) weakSelf = self; + BOOL isFSCreateFinish = [self weexInstance].isJSCreateFinish; [self _addUITask:^{ [WXTracingManager startTracingWithInstanceId:weakSelf.weexInstance.instanceId ref:componentData[@"ref"] className:nil name:componentData[@"type"] phase:WXTracingBegin functionName:@"addElement" options:@{@"threadName":WXTUIThread}]; [supercomponent insertSubview:component atIndex:index]; [WXTracingManager startTracingWithInstanceId:weakSelf.weexInstance.instanceId ref:componentData[@"ref"] className:nil name:componentData[@"type"] phase:WXTracingEnd functionName:@"addElement" options:@{@"threadName":WXTUIThread}]; + [weakSelf onElementChange:isFSCreateFinish]; }]; } @@ -348,6 +354,7 @@ static css_node_t * rootNodeGetChild(void *context, int i) [_indexDict removeObjectForKey:ref]; __weak typeof(self) weakSelf = self; + BOOL isFSCreateFinish = [self weexInstance].isJSCreateFinish; [self _addUITask:^{ [WXTracingManager startTracingWithInstanceId:weakSelf.weexInstance.instanceId ref:ref className:nil name:nil phase:WXTracingBegin functionName:@"removeElement" options:@{@"threadName":WXTUIThread}]; if (component.supercomponent) { @@ -355,9 +362,53 @@ static css_node_t * rootNodeGetChild(void *context, int i) } [component removeFromSuperview]; [WXTracingManager startTracingWithInstanceId:weakSelf.weexInstance.instanceId ref:ref className:nil name:nil phase:WXTracingEnd functionName:@"removeElement" options:@{@"threadName":WXTUIThread}]; + [weakSelf onElementChange:isFSCreateFinish]; }]; [self _checkFixedSubcomponentToRemove:component]; + +} + +- (void)onElementChange:(BOOL)isFSCreateFinish +{ + if (!isFSCreateFinish) { + return; + } + + UIView *root = [self weexInstance].rootView; + BOOL hasEvent = TRUE; + if (root && [root isKindOfClass:[WXRootView class]]) { + WXRootView* wxRootView = (WXRootView *)root; + hasEvent = [wxRootView isHasEvent]; + } + if (hasEvent) { + return; + } + double current = CACurrentMediaTime()*1000; + + double diff = current - [self weexInstance].performance.jsCreateFinishTime; + if (diff > 8000) { + return; + } + [self weexInstance].performance.interactionTime = current - self.weexInstance.performance.renderTimeOrigin; +} + +- (void)recordMaximumVirtualDom:(WXComponent*) component +{ + WXAssertComponentExist(component); + if(!component){ + return; + } + int maxDeep =0; + while (component) { + maxDeep++; + component = component.supercomponent; + } + if(maxDeep > [self weexInstance].performance.maxVdomDeep) + { + [self weexInstance].performance.maxVdomDeep = maxDeep; + } + } - (void)_checkFixedSubcomponentToRemove:(WXComponent *)component @@ -678,6 +729,7 @@ static css_node_t * rootNodeGetChild(void *context, int i) instance.renderFinish(rootView); } }]; + [instance updatePerDicAfterCreateFinish]; } - (void)updateFinish http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Manager/WXTracingManager.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXTracingManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXTracingManager.m index 07237e6..e0f00e2 100644 --- a/ios/sdk/WeexSDK/Sources/Manager/WXTracingManager.m +++ b/ios/sdk/WeexSDK/Sources/Manager/WXTracingManager.m @@ -364,7 +364,7 @@ tracing.parentId = [self getParentId:task tracing:tracing]; } } - + } if([WXTracingEnd isEqualToString:tracing.ph]){ // deal end NSMutableArray *tracings = task.tracings; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index 50de348..4f6f2ec 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@ -49,6 +49,7 @@ #import "WXMonitor.h" #import "WXBridgeContext.h" #import "WXJSCoreBridge.h" +#import "WXSDKInstance_performance.h" NSString *const bundleUrlOptionKey = @"bundleUrl"; @@ -115,6 +116,8 @@ typedef enum : NSUInteger { _trackComponent = NO; _performanceCommit = NO; + _performance = [[WXPerformance alloc] init]; + id configCenter = [WXSDKEngine handlerForProtocol:@protocol(WXConfigCenterProtocol)]; if ([configCenter respondsToSelector:@selector(configForKey:defaultValue:isDefault:)]) { _syncDestroyComponentManager = [[configCenter configForKey:@"iOS_weex_ext_config.syncDestroyComponentManager" defaultValue:@(YES) isDefault:NULL] boolValue]; @@ -229,6 +232,7 @@ typedef enum : NSUInteger { WXLogError(@"Fail to find instanceï¼"); return; } + self.performance.renderTimeOrigin = CACurrentMediaTime()*1000; if (![WXUtility isBlankString:self.pageName]) { WXLog(@"Start rendering page:%@", self.pageName); @@ -407,6 +411,8 @@ typedef enum : NSUInteger { [strongSelf _renderWithMainBundleString:jsBundleString]; [WXTracingManager setBundleJSType:jsBundleString instanceId:weakSelf.instanceId]; + [WXMonitor performanceFinishWithState:DebugAfterRequest instance:strongSelf]; + }; _mainBundleLoader.onFailed = ^(NSError *loadError) { @@ -504,6 +510,7 @@ typedef enum : NSUInteger { } if (!_performanceCommit && state == WeexInstanceDisappear) { + [self updatePerDicBeforExit]; WX_MONITOR_INSTANCE_PERF_COMMIT(self); _performanceCommit = YES; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.h ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.h b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.h new file mode 100644 index 0000000..03f1b99 --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.h @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "WXSDKInstance.h" + +@interface WXPerformance : NSObject + + +@property (nonatomic, assign) double renderTimeOrigin; +@property (nonatomic, assign) double jsCreateFinishTime; + +//firsrScreen call jsMethod totalTime +@property (nonatomic, assign) double fsCallJsTime; +//firsrScreen call jsMethod totalNum +@property (nonatomic, assign) double fsCallJsNum; +//firsrScreen call nativeMethod totalTime +@property (nonatomic, assign) double fsCallNativeTime; +//firsrScreen call nativeMethod totalNum +@property (nonatomic, assign) double fsCallNativeNum; +//firsrScreen call event totalNum +@property (nonatomic, assign) double fsCallEventNum; +//firsrScreen request netWrork totalNum +@property (nonatomic, assign) double fsReqNetNum; +// +@property (nonatomic, assign) double cellExceedNum; +//max dom deep +@property (nonatomic, assign) double maxVdomDeep; +//unMatch img in imgView num +@property (nonatomic, assign) double imgWrongSizeNum; +//call setTimeOut Num +@property (nonatomic, assign) double timerNum; +//time of user could interace : firsrScreen view or async load veiew(net lazyload) are show) +@property (nonatomic, assign) double interactionTime; + +@end + + +@interface WXSDKInstance () + +@property (nonatomic, assign) BOOL isJSCreateFinish; +@property (nonatomic,strong) WXPerformance* performance; + +@end + +@interface WXSDKInstance (Performance) + +- (void) updatePerDicAfterCreateFinish; +- (void) updatePerDicBeforExit; +@end + + http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m new file mode 100644 index 0000000..f2c11bd --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m @@ -0,0 +1,35 @@ + +#import <Foundation/Foundation.h> +#import "WXSDKInstance_performance.h" +#import "WXMonitor.h" + +@implementation WXPerformance + +@end + +@implementation WXSDKInstance (Performance) + +- (void) updatePerDicAfterCreateFinish +{ + [WXMonitor performanceFinishWithState:DebugAfterFSFinish instance:self]; + self.performance.jsCreateFinishTime = CACurrentMediaTime()*1000; + self.isJSCreateFinish = TRUE; + WX_MONITOR_PERF_SET(WXPTFsCallJsNum, self.performance.fsCallJsNum, self); + WX_MONITOR_PERF_SET(WXPTFsCallJsTime, self.performance.fsCallJsTime, self); + WX_MONITOR_PERF_SET(WXPTFsCallNativeNum, self.performance.fsCallNativeNum, self); + WX_MONITOR_PERF_SET(WXPTFsCallNativeTime, self.performance.fsCallNativeTime, self); + WX_MONITOR_PERF_SET(WXPTFsReqNetNum, self.performance.fsReqNetNum, self); + WX_MONITOR_PERF_SET(WXPTTimerNum, self.performance.timerNum, self); +} + + +- (void)updatePerDicBeforExit +{ + WX_MONITOR_PERF_SET(WXPTCellExceedNum,self.performance.cellExceedNum,self); + WX_MONITOR_PERF_SET(WXPTMaxDeepVDom,self.performance.maxVdomDeep,self); + WX_MONITOR_PERF_SET(WXPTImgWrongSizeNum,self.performance.imgWrongSizeNum,self); + WX_MONITOR_PERF_SET(WXPTImgWrongSizeNum,self.performance.imgWrongSizeNum,self); + WX_MONITOR_PERF_SET(WXPTInteractionTime,self.performance.interactionTime,self); +} + +@end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m b/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m index 046d683..abbbb50 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m @@ -25,6 +25,8 @@ #import "WXURLRewriteProtocol.h" #import "WXResourceLoader.h" #import "WXSDKEngine.h" +#import "WXSDKInstance_performance.h" +#import "WXMonitor.h" @implementation WXStreamModule @@ -128,6 +130,10 @@ WX_EXPORT_METHOD(@selector(fetchWithArrayBuffer:options:callback:progressCallbac return nil; } + if (self.weexInstance && !weexInstance.isJSCreateFinish) { + self.weexInstance.performance.fsReqNetNum++; + } + WXResourceRequest *request = [WXResourceRequest requestWithURL:[NSURL URLWithString:urlStr] resourceType:WXResourceTypeOthers referrer:nil cachePolicy:NSURLRequestUseProtocolCachePolicy]; // parse http method http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m b/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m index 6855466..0827b63 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXTimerModule.m @@ -21,6 +21,8 @@ #import "WXSDKManager.h" #import "WXLog.h" #import "WXAssert.h" +#import "WXMonitor.h" +#import "WXSDKInstance_performance.h" @interface WXTimerTarget : NSObject @@ -41,6 +43,10 @@ _callbackID = callbackID; _weexInstance = weexInstance; _shouldRepeat = shouldRepeat; + + if (weexInstance && !weexInstance.isJSCreateFinish) { + weexInstance.performance.timerNum++; + } } return self; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter+Transfer.h ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter+Transfer.h b/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter+Transfer.h new file mode 100644 index 0000000..ebdea69 --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter+Transfer.h @@ -0,0 +1,15 @@ + +#import <Foundation/Foundation.h> +#import "WXSDKInstance.h" +#import "WXMonitor.h" +#import "WXAnalyzerCenter.h" + +@interface WXAnalyzerCenter (Transfer) + ++(void) transDataOnState:(CommitState) timeState withInstaneId:(NSString *)instanceId data:(NSDictionary *)data ; + ++ (void) transErrorInfo:(WXJSExceptionInfo *)errorInfo; + ++ (BOOL) needTransfer; + +@end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.h ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.h b/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.h new file mode 100644 index 0000000..18b548f --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.h @@ -0,0 +1,16 @@ + +#import <Foundation/Foundation.h> +#import "WXAnalyzerProtocol.h" + +@interface WXAnalyzerCenter : NSObject + ++(NSMutableArray<WXAnalyzerProtocol> *) getAnalyzerList; + ++(void) addWxAnalyzer:(id<WXAnalyzerProtocol>)handler; + ++(void) rmWxAnalyzer:(id<WXAnalyzerProtocol>)handler; + ++(void) setOpen:(BOOL)isOpen; ++(BOOL) isOpen; + +@end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.m b/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.m new file mode 100644 index 0000000..181f923 --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Monitor/WXAnalyzerCenter.m @@ -0,0 +1,234 @@ +#import <Foundation/Foundation.h> +#import "WXAnalyzerCenter.h" +#import "WXAnalyzerProtocol.h" +#import "WXAppMonitorProtocol.h" +#import "WXSDKManager.h" +#import "WXLog.h" +#import "WXTracingManager.h" +#import "WXAnalyzerCenter.h" +#import "WXAnalyzerCenter+Transfer.h" +#import "WXUtility.h" + +@interface WXAnalyzerCenter () +@property (nonatomic, strong) NSMutableArray<WXAnalyzerProtocol> *analyzerList; +@property (nonatomic, assign) BOOL anzlyzerSwitch; +@end + +@implementation WXAnalyzerCenter + ++ (instancetype) sharedInstance{ + + static WXAnalyzerCenter *instance = nil; + static dispatch_once_t once; + + dispatch_once(&once, ^{ + instance = [[WXAnalyzerCenter alloc] init]; + instance.analyzerList= [NSMutableArray<WXAnalyzerProtocol> new]; + instance.anzlyzerSwitch = FALSE; + }); + + return instance; +} + ++ (void) transDataOnState:(CommitState) timeState withInstaneId:(NSString *)instanceId data:(NSDictionary *)data +{ + if (![self isOpen]) { + return; + } + if (!instanceId) { + return; + } + WXSDKInstance * instance = [WXSDKManager instanceForID:instanceId]; + if (!instance) { + return; + } + + NSDictionary *commitDimenKeys = [self getKeys:TRUE]; + NSDictionary *commitMeasureKeys = [self getKeys:FALSE]; + for(id key in data){ + if([self checkDataWithSate:timeState checkKey:key limitDic:commitMeasureKeys]){ + [self _transMeasureValue:instance key:key withVal:[data valueForKey:key]]; + }else if([self checkDataWithSate:timeState checkKey:key limitDic:commitDimenKeys]){ + [self _transDimenValue:instance key:key withVal:[data valueForKey:key]]; + }else{ + // WXLogDebug(@"WXAnalyzerDataTransfer -> unKnowPerformanceKey :%@",key); + } + } +} + ++(BOOL) checkDataWithSate:(CommitState)timeState checkKey:(id)key limitDic:(NSDictionary *)limitDic +{ + if (!key || ![key isKindOfClass:[NSString class]]) { + return FALSE; + } + + if (![limitDic objectForKey:key]) { + return FALSE; + } + CommitState limitSate = [[limitDic objectForKey:key] intValue]; + if (timeState != limitSate) { + return FALSE; + } + return TRUE; +} + ++ (NSDictionary *) getKeys:(BOOL) measureOrDimen +{ + static NSDictionary *commitDimenKeys; + static NSDictionary *commitMeasureKeys; + static dispatch_once_t onceToken; + + dispatch_once(&onceToken, ^{ + // non-standard perf commit names, remove this hopefully. + + commitDimenKeys =@{ + BIZTYPE: [NSNumber numberWithInt:DebugAfterFSFinish], + PAGENAME: [NSNumber numberWithInt:DebugAfterRequest], + WXSDKVERSION: [NSNumber numberWithInt:DebugAfterRequest], + JSLIBVERSION: [NSNumber numberWithInt:DebugAfterRequest], + JSLIBSIZE: [NSNumber numberWithInt:DebugAfterRequest], + WXREQUESTTYPE: [NSNumber numberWithInt:DebugAfterRequest], + WXCONNECTIONTYPE: [NSNumber numberWithInt:DebugAfterRequest], + NETWORKTYPE: [NSNumber numberWithInt:DebugAfterRequest], + CACHETYPE: [NSNumber numberWithInt:DebugAfterRequest], + WXCUSTOMMONITORINFO: [NSNumber numberWithInt:DebugAfterRequest] + }; + commitMeasureKeys =@{ + SDKINITTIME: [NSNumber numberWithInt:DebugAfterFSFinish], + SDKINITINVOKETIME: [NSNumber numberWithInt:DebugAfterFSFinish], + JSLIBINITTIME: [NSNumber numberWithInt:DebugAfterFSFinish], + JSTEMPLATESIZE: [NSNumber numberWithInt:DebugAfterRequest], + NETWORKTIME: [NSNumber numberWithInt:DebugAfterRequest], + COMMUNICATETIME: [NSNumber numberWithInt:DebugAfterExist], + SCREENRENDERTIME: [NSNumber numberWithInt:DebugAfterExist], + TOTALTIME: [NSNumber numberWithInt:DebugAfterExist], + FIRSETSCREENJSFEXECUTETIME: [NSNumber numberWithInt:DebugAfterFSFinish], + CALLCREATEINSTANCETIME: [NSNumber numberWithInt:DebugAfterFSFinish], + COMMUNICATETOTALTIME: [NSNumber numberWithInt:DebugAfterExist], + FSRENDERTIME: [NSNumber numberWithInt:DebugAfterExist], + COMPONENTCOUNT: [NSNumber numberWithInt:DebugAfterExist], + CACHEPROCESSTIME: [NSNumber numberWithInt:DebugAfterRequest], + CACHERATIO: [NSNumber numberWithInt:DebugAfterRequest], + M_FS_CALL_JS_TIME: [NSNumber numberWithInt:DebugAfterFSFinish], + M_FS_CALL_JS_NUM: [NSNumber numberWithInt:DebugAfterFSFinish], + M_FS_CALL_NATIVE_TIME: [NSNumber numberWithInt:DebugAfterFSFinish], + M_FS_CALL_NATIVE_NUM: [NSNumber numberWithInt:DebugAfterFSFinish], + M_FS_CALL_EVENT_NUM: [NSNumber numberWithInt:DebugAfterFSFinish], + M_CELL_EXCEED_NUM: [NSNumber numberWithInt:DebugAfterFSFinish], + M_MAX_DEEP_VDOM: [NSNumber numberWithInt:DebugAfterExist], + M_IMG_WRONG_SIZE_NUM: [NSNumber numberWithInt:DebugAfterExist], + M_TIMER_NUM: [NSNumber numberWithInt:DebugAfterFSFinish] + }; + + }); + return measureOrDimen?commitMeasureKeys:commitDimenKeys; +} + ++ (void) _transMeasureValue:(WXSDKInstance *)instance key:(NSString *)commitKey withVal:(id)commitVal +{ + [self _transDataToAnaylzer:instance + withModule:MODULE_PERFORMANCE + withType:TYPE_MEASURE_REAL + withData:@{commitKey:commitVal} + ]; +} + ++ (void) _transDimenValue:(WXSDKInstance *)instance key:(NSString *)commitKey withVal:(id)commitVal +{ + [self _transDataToAnaylzer:instance + withModule:MODULE_PERFORMANCE + withType:TYPE_DIMEN_REAL + withData:@{commitKey:commitVal} + ]; +} + ++(void) _transDataToAnaylzer:(WXSDKInstance *)instance withModule:(NSString *)module withType:(NSString *)type withData:(NSDictionary *)data +{ + NSMutableArray* analyzerList = [self getAnalyzerList]; + if (nil == analyzerList) { + return; + } + + NSMutableDictionary *wrapDic = [data mutableCopy]; + [wrapDic setObject:instance.instanceId forKey:@"instanceId"]; + [wrapDic setObject:[instance.scriptURL absoluteString] forKey:@"url"]; + [wrapDic setValue:GROUP_ANALYZER forKey:@"group"]; + [wrapDic setValue:module forKey:@"module"]; + [wrapDic setValue:type forKey:@"type"]; + + + if ([self needTransfer]) { + for (id analyzer in analyzerList) { + if ( [analyzer respondsToSelector:(@selector(transfer:))]) + { + [analyzer performSelector:@selector(transfer:) withObject:wrapDic]; + } + } + } + + +} + ++(void)transErrorInfo:(WXJSExceptionInfo *)errorInfo +{ + if (!errorInfo) { + return; + } + WXSDKInstance *instance = [WXSDKManager instanceForID:errorInfo.instanceId]; + if (!instance) { + return; + } + NSDictionary *dic= @{ + @"errorCode":errorInfo.errorCode, + @"errorGroup":@"", + @"errorMsg":errorInfo.exception + }; + + [self _transDataToAnaylzer:instance + withModule:MODULE_ERROR + withType:TYPE_JS_ERROR + withData:dic + ]; +} + ++ (void) addWxAnalyzer:(id<WXAnalyzerProtocol>)handler +{ + if (!handler) { + return; + } + [[WXAnalyzerCenter sharedInstance].analyzerList addObject:handler]; +} + ++ (void) rmWxAnalyzer:(id<WXAnalyzerProtocol>)handler +{ + if (!handler) { + return; + } + [[WXAnalyzerCenter sharedInstance].analyzerList removeObject:handler]; +} + ++ (NSMutableArray<WXAnalyzerProtocol> *)getAnalyzerList +{ + return [WXAnalyzerCenter sharedInstance].analyzerList; +} + ++(BOOL) needTransfer +{ + NSMutableArray* analyzerList = [self getAnalyzerList]; + if (nil == analyzerList || analyzerList.count <= 0) { + return FALSE; + } + return TRUE; +} + ++ (void)setOpen:(BOOL)isOpen +{ + [WXAnalyzerCenter sharedInstance].anzlyzerSwitch = isOpen; +} + ++ (BOOL)isOpen +{ + return [WXAnalyzerCenter sharedInstance].anzlyzerSwitch; +} + +@end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.m b/ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.m index de784fd..246b077 100644 --- a/ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.m +++ b/ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.m @@ -25,6 +25,8 @@ #import "WXJSExceptionInfo.h" #import "WXUtility.h" #import "WXSDKManager.h" +#import "WXAnalyzerCenter+Transfer.h" + @implementation WXExceptionUtils @@ -52,6 +54,9 @@ if ([jsExceptionHandler respondsToSelector:@selector(onJSException:)]) { [jsExceptionHandler onJSException:jsExceptionInfo]; } + if ([WXAnalyzerCenter isOpen]) { + [WXAnalyzerCenter transErrorInfo:jsExceptionInfo]; + } } @end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.h ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.h b/ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.h index 4a399d2..c5b27d8 100644 --- a/ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.h +++ b/ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.h @@ -35,6 +35,21 @@ typedef enum : NSUInteger { WXPTFirstScreenRender, WXPTAllRender, WXPTBundleSize, + //new point + //doc see @WXPerformance + WXPTFsCallJsTime, + WXPTFsCallJsNum, + WXPTFsCallNativeTime, + WXPTFsCallNativeNum, + WXPTFsCallEventNum, + WXPTFsReqNetNum, + WXPTCellExceedNum, + WXPTMaxDeepVDom, + WXPTImgWrongSizeNum, + WXPTTimerNum, + WXPTInteractionTime, + WXPTWrongImgSize, + //end WXPTEnd } WXPerformanceTag; @@ -46,6 +61,16 @@ typedef enum : NSUInteger { WXMTJSService, } WXMonitorTag; +typedef NS_ENUM(NSInteger, CommitState) +{ + MonitorCommit, + + //just use on Debug mode + DebugAfterRequest, + DebugAfterFSFinish, + DebugAfterExist, + DebugOnRealTime +}; #define WX_MONITOR_SUCCESS_ON_PAGE(tag, pageName) [WXMonitor monitoringPointDidSuccess:tag onPage:pageName]; #define WX_MONITOR_FAIL_ON_PAGE(tag, errorCode, errorMessage, pageName) \ @@ -76,4 +101,6 @@ NSError *error = [NSError errorWithDomain:WX_ERROR_DOMAIN \ + (void)monitoringPointDidSuccess:(WXMonitorTag)tag onPage:(NSString *)pageName; + (void)monitoringPoint:(WXMonitorTag)tag didFailWithError:(NSError *)error onPage:(NSString *)pageName; ++ (void)performanceFinishWithState:(CommitState) state instance:(WXSDKInstance *)instance; + @end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.m b/ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.m index db215b1..cb7c4ee 100644 --- a/ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.m +++ b/ios/sdk/WeexSDK/Sources/Monitor/WXMonitor.m @@ -6,7 +6,7 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, @@ -28,6 +28,11 @@ #import "WXThreadSafeMutableDictionary.h" #import "WXAppConfiguration.h" #import "WXTracingManager.h" +#import "WXAnalyzerProtocol.h" +#import "WXSDKInstance_performance.h" + +#import "WXAnalyzerCenter+Transfer.h" + NSString *const kStartKey = @"start"; NSString *const kEndKey = @"end"; @@ -44,6 +49,7 @@ static WXThreadSafeMutableDictionary *globalPerformanceDict; NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity:2]; dict[kStartKey] = @(CACurrentMediaTime() * 1000); performanceDict[@(tag)] = dict; + [dict setValue:@(tag) forKey:@"tag"]; } + (void)performancePoint:(WXPerformanceTag)tag didEndWithInstance:(WXSDKInstance *)instance @@ -61,7 +67,7 @@ static WXThreadSafeMutableDictionary *globalPerformanceDict; } dict[kEndKey] = @(CACurrentMediaTime() * 1000); - + // if (tag == WXPTAllRender) { // [self performanceFinish:instance]; // } @@ -92,6 +98,21 @@ static WXThreadSafeMutableDictionary *globalPerformanceDict; + (void)performanceFinish:(WXSDKInstance *)instance { + [self performanceFinishWithState:MonitorCommit instance:instance]; +} + ++ (void)performanceFinishWithState:(CommitState) state instance:(WXSDKInstance *)instance +{ + BOOL collectValue = (state == MonitorCommit); + +#ifdef DEBUG + collectValue = TRUE; +#endif + + if(!collectValue) + { + return; + } NSMutableDictionary *commitDict = [NSMutableDictionary dictionary]; commitDict[BIZTYPE] = instance.bizType ?: @""; @@ -134,12 +155,12 @@ static WXThreadSafeMutableDictionary *globalPerformanceDict; WXPerformBlockOnComponentThread(^{ commitDict[COMPONENTCOUNT] = @([instance numberOfComponents]); WXPerformBlockOnMainThread(^{ - [self commitPerformanceWithDict:commitDict instance:instance]; + [self commitPerformanceWithDict:commitDict instance:instance comitState:state]; }); }); } -+ (void)commitPerformanceWithDict:(NSMutableDictionary *)commitDict instance:(WXSDKInstance *)instance ++ (void)commitPerformanceWithDict:(NSMutableDictionary *)commitDict instance:(WXSDKInstance *)instance comitState:(CommitState) state { static NSDictionary *commitKeyDict; static dispatch_once_t onceToken; @@ -154,7 +175,19 @@ static WXThreadSafeMutableDictionary *globalPerformanceDict; @(WXFirstScreenJSFExecuteTime) : FIRSETSCREENJSFEXECUTETIME, @(WXPTFirstScreenRender) : SCREENRENDERTIME, @(WXPTAllRender) : TOTALTIME, - @(WXPTBundleSize) : JSTEMPLATESIZE + @(WXPTBundleSize) : JSTEMPLATESIZE, + @(WXPTFsCallJsTime): M_FS_CALL_JS_TIME, + @(WXPTFsCallJsNum): M_FS_CALL_JS_NUM, + @(WXPTFsCallNativeTime): M_FS_CALL_NATIVE_TIME, + @(WXPTFsCallNativeNum): M_FS_CALL_NATIVE_NUM, + @(WXPTFsCallEventNum): M_FS_CALL_EVENT_NUM, + @(WXPTMaxDeepVDom): M_MAX_DEEP_VDOM, + @(WXPTImgWrongSizeNum): M_IMG_WRONG_SIZE_NUM, + @(WXPTTimerNum): M_TIMER_NUM, + @(WXPTCellExceedNum):M_CELL_EXCEED_NUM, + @(WXPTWrongImgSize):M_IMG_WRONG_SIZE_NUM, + @(WXPTInteractionTime):M_INTERACTION_TIME, + @(WXPTFsReqNetNum):M_FS_REQUEST_NET_NUM }; }); @@ -169,12 +202,18 @@ static WXThreadSafeMutableDictionary *globalPerformanceDict; NSNumber *end = keyDict[kEndKey]; if (!start || !end) { - WXLogWarning(@"Performance point:%d, in instance:%@, did not have a start or end", tag, instance); + if (state == MonitorCommit) { + WXLogWarning(@"Performance point:%d, in instance:%@, did not have a start or end", tag, instance); + } continue; } NSString *commitKey = commitKeyDict[@(tag)]; - commitDict[commitKey] = @([end integerValue] - [start integerValue]); + if (commitKey) { + commitDict[commitKey] = @([end integerValue] - [start integerValue]); + }else{ + WXLogWarning(@"commitKey is nil with tag :%d",tag); + } } commitDict[@"instanceId"] = [instance instanceId]?:@""; @@ -193,14 +232,22 @@ static WXThreadSafeMutableDictionary *globalPerformanceDict; else { commitDict[FSRENDERTIME] = @"-1"; } - - id<WXAppMonitorProtocol> appMonitor = [WXHandlerFactory handlerForProtocol:@protocol(WXAppMonitorProtocol)]; - if (appMonitor && [appMonitor respondsToSelector:@selector(commitAppMonitorArgs:)]){ - [appMonitor commitAppMonitorArgs:commitDict]; + if(state == MonitorCommit) + { + id<WXAppMonitorProtocol> appMonitor = [WXHandlerFactory handlerForProtocol:@protocol(WXAppMonitorProtocol)]; + if (appMonitor && [appMonitor respondsToSelector:@selector(commitAppMonitorArgs:)]){ + [appMonitor commitAppMonitorArgs:commitDict]; + } + + [self printPerformance:commitDict]; + [WXTracingManager commitTracingSummaryInfo:commitDict withInstanceId:instance.instanceId]; + } + if ([WXAnalyzerCenter isOpen]) { + if (state == MonitorCommit) { + state = DebugAfterExist; + } + [WXAnalyzerCenter transDataOnState:state withInstaneId:instance.instanceId data:commitDict]; } - - [self printPerformance:commitDict]; - [WXTracingManager commitTracingSummaryInfo:commitDict withInstanceId:instance.instanceId]; } + (NSMutableDictionary *)performanceDictForInstance:(WXSDKInstance *)instance http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/Protocol/WXAnalyzerProtocol.h ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Protocol/WXAnalyzerProtocol.h b/ios/sdk/WeexSDK/Sources/Protocol/WXAnalyzerProtocol.h new file mode 100644 index 0000000..73223cc --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Protocol/WXAnalyzerProtocol.h @@ -0,0 +1,25 @@ +#import <Foundation/Foundation.h> +#import "WXAppMonitorProtocol.h" + +#define GROUP_ANALYZER @"WXAnalyzer" +#define MODULE_PERFORMANCE @"WXPerformance" +#define MODULE_ERROR @"WXError" +#define TYPE_MEASURE_REAL @"measure_real_time" +#define TYPE_DIMEN_REAL @"dimen_real_time" +#define TYPE_JS_ERROR @"js" + +@protocol WXAnalyzerProtocol <NSObject> + + +@required +/** + @param value = @{ + @"group":group, + @"module":module, + @"type":type, + @"data":jsonData + }; + */ +- (void)transfer:(NSDictionary *) value; + +@end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/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 e2f0465..65a86a2 100644 --- a/ios/sdk/WeexSDK/Sources/Protocol/WXAppMonitorProtocol.h +++ b/ios/sdk/WeexSDK/Sources/Protocol/WXAppMonitorProtocol.h @@ -19,6 +19,7 @@ #import "WXModuleProtocol.h" +/** dimenValue */ #define BIZTYPE @"bizType" #define PAGENAME @"pageName" #define WXSDKVERSION @"WXSDKVersion" @@ -30,6 +31,8 @@ #define CACHETYPE @"cacheType" #define WXCUSTOMMONITORINFO @"customMonitorInfo" +/** measureValue */ + #define SDKINITTIME @"SDKInitTime" #define SDKINITINVOKETIME @"SDKInitInvokeTime" #define JSLIBINITTIME @"JSLibInitTime" @@ -48,6 +51,22 @@ #define CACHEPROCESSTIME @"cacheProcessTime" #define CACHERATIO @"cacheRatio" +//todo new point +#define M_FS_CALL_JS_TIME @"fsCallJsTotalTime" +#define M_FS_CALL_JS_NUM @"fsCallJsTotalNum" +#define M_FS_CALL_NATIVE_TIME @"fsCallNativeTotalTime" +#define M_FS_CALL_NATIVE_NUM @"fsCallNativeTotalNum" +#define M_FS_CALL_EVENT_NUM @"fsCallEventTotalNum" +#define M_FS_REQUEST_NET_NUM @"fsRequestNum" +#define M_CELL_EXCEED_NUM @"cellExceedNum" +#define M_MAX_DEEP_VDOM @"maxDeepVDomLayer" +#define M_IMG_WRONG_SIZE_NUM @"imgSizeCount" +#define M_TIMER_NUM @"timerCount" +#define M_WRONG_IMG_NUM @"imgSizeCount" +#define M_INTERACTION_TIME @"interactionTime" + + + @protocol WXAppMonitorProtocol <WXModuleProtocol> - (void)commitAppMonitorArgs:(NSDictionary *)args; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/View/WXRootView.h ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/View/WXRootView.h b/ios/sdk/WeexSDK/Sources/View/WXRootView.h index b0605be..2f1453f 100644 --- a/ios/sdk/WeexSDK/Sources/View/WXRootView.h +++ b/ios/sdk/WeexSDK/Sources/View/WXRootView.h @@ -24,4 +24,6 @@ @property (nonatomic, weak) WXSDKInstance *instance; +- (BOOL) isHasEvent; + @end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/View/WXRootView.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/View/WXRootView.m b/ios/sdk/WeexSDK/Sources/View/WXRootView.m index acb2a3d..11fb48d 100644 --- a/ios/sdk/WeexSDK/Sources/View/WXRootView.m +++ b/ios/sdk/WeexSDK/Sources/View/WXRootView.m @@ -20,6 +20,12 @@ #import "WXRootView.h" #import "WXSDKInstance.h" +@interface WXRootView() + +@property (nonatomic, assign) BOOL mHasEvent; + +@end + @implementation WXRootView - (void)setFrame:(CGRect)frame @@ -36,4 +42,15 @@ } } +- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event +{ + _mHasEvent = TRUE; + return [super hitTest:point withEvent:event]; +} + +- (BOOL)isHasEvent +{ + return false; +} + @end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/481a998b/ios/sdk/WeexSDK/Sources/WeexSDK.h ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/WeexSDK.h b/ios/sdk/WeexSDK/Sources/WeexSDK.h index 3ed4385..9d5ddcd 100644 --- a/ios/sdk/WeexSDK/Sources/WeexSDK.h +++ b/ios/sdk/WeexSDK/Sources/WeexSDK.h @@ -68,6 +68,8 @@ #import "WXBaseViewController.h" #import "WXAppMonitorProtocol.h" #import "WXAppConfiguration.h" +#import "WXAnalyzerProtocol.h" +#import "WXAnalyzerCenter.h" #import "WXAComponent.h" #import "NSObject+WXSwizzle.h" #import "Layout.h"