Skip to content

Commit

Permalink
feat: release 0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
YoloMao committed Oct 28, 2022
1 parent 1949e27 commit e26c647
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Core/GrowingAPM.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN

+ (void)startWithConfig:(GrowingAPMConfig *)config;

+ (void)swizzle:(GrowingAPMMonitors)monitors;
+ (void)setupMonitors:(GrowingAPMMonitors)monitors appDelegateClass:(Class)appDelegateClass;

@end

Expand Down
11 changes: 3 additions & 8 deletions Core/GrowingAPM.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ @interface GrowingAPM ()
@property (nonatomic, strong, readwrite) id <GrowingAPMMonitor> pageLoadMonitor;
@property (nonatomic, strong, readwrite) id <GrowingAPMMonitor> networkMonitor;

#ifdef GROWING_APM_UI
@property (nonatomic, assign) double coldRebootBeginTime;
#endif

#ifdef GROWING_APM_CRASH
@property (class, nonatomic, weak) GrowingCrashInstallation *crashInstallation;
#endif
Expand Down Expand Up @@ -97,7 +93,6 @@ + (void)startWithConfig:(GrowingAPMConfig *)config {
if (config.monitors & GrowingAPMMonitorsUserInterface) {
#ifdef GROWING_APM_UI
GrowingAPMUIMonitor *monitor = [GrowingAPMUIMonitor sharedInstance];
monitor.coldRebootBeginTime = apm.coldRebootBeginTime;
[monitor startMonitor];
apm.pageLoadMonitor = (id <GrowingAPMMonitor>)monitor;
#endif
Expand All @@ -118,12 +113,12 @@ + (void)startWithConfig:(GrowingAPMConfig *)config {
}
}

+ (void)swizzle:(GrowingAPMMonitors)monitors {
+ (void)setupMonitors:(GrowingAPMMonitors)monitors appDelegateClass:(Class)appDelegateClass {
if (monitors & GrowingAPMMonitorsUserInterface) {
#ifdef GROWING_APM_UI
[GrowingAppLifecycle setup];
[GrowingAPMUIMonitor setup];
GrowingAPM.sharedInstance.coldRebootBeginTime = GrowingTimeUtil.currentSystemTimeMillis;
GrowingAPMUIMonitor.mainStartTime = GrowingTimeUtil.currentSystemTimeMillis;
[GrowingAPMUIMonitor setup:appDelegateClass];
#endif
}

Expand Down
1 change: 0 additions & 1 deletion Core/GrowingAPMMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ NS_ASSUME_NONNULL_BEGIN

@optional
+ (instancetype)sharedInstance;
+ (void)setup;

@end

Expand Down
14 changes: 7 additions & 7 deletions CrashMonitor/GrowingAPMCrashMonitor.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7</string>
<string>ios-arm64_i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>GrowingAPMCrashMonitor.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_i386_x86_64-simulator</string>
<string>ios-arm64_armv7</string>
<key>LibraryPath</key>
<string>GrowingAPMCrashMonitor.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
<string>armv7</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion GrowingAPM.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'GrowingAPM'
s.version = '0.0.2'
s.version = '0.0.3'
s.summary = 'iOS SDK of GrowingIO.'
s.description = <<-DESC
GrowingAPM提供移动端性能采集分析功能,包括崩溃分析、启动分析、页面加载分析等。
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ pod 'GrowingAPM/CrashMonitor'
#import "GrowingAPM.h"
```

- 在 main 函数中,添加如下代码 (此操作仅为了尽可能地在 App 运行前 Swizzle,除必要的崩溃日志本地缓存外,不会生成、上报数据):
- 在 main 函数中,添加如下代码 (此操作仅为了尽可能地在 App 运行前开启监测,除必要的崩溃日志本地缓存外,不会生成、上报数据):

```objc
int main(int argc, char * argv[]) {
// GrowingAPM Swizzle
[GrowingAPM swizzle:GrowingAPMMonitorsCrash | GrowingAPMMonitorsUserInterface];
[GrowingAPM setupMonitors:GrowingAPMMonitorsCrash | GrowingAPMMonitorsUserInterface
appDelegateClass:[AppDelegate class]];
NSString * appDelegateClassName;
@autoreleasepool {
// Setup code that might create autoreleased objects goes here.
Expand Down
14 changes: 7 additions & 7 deletions UIMonitor/GrowingAPMUIMonitor.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7</string>
<string>ios-arm64_i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>GrowingAPMUIMonitor.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_i386_x86_64-simulator</string>
<string>ios-arm64_armv7</string>
<key>LibraryPath</key>
<string>GrowingAPMUIMonitor.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
<string>armv7</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ typedef void(^GrowingAPMUIMonitorBlock)(NSString *pageName, double loadDuration,
@interface GrowingAPMUIMonitor : NSObject

@property (nonatomic, copy) GrowingAPMUIMonitorBlock monitorBlock;
@property (nonatomic, assign) double coldRebootBeginTime;

@property (class, nonatomic, assign) double mainStartTime;

+ (instancetype)sharedInstance;
+ (void)setup;
+ (void)setup:(Class)appDelegateClass;
- (void)startMonitor;

@end
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ typedef void(^GrowingAPMUIMonitorBlock)(NSString *pageName, double loadDuration,
@interface GrowingAPMUIMonitor : NSObject

@property (nonatomic, copy) GrowingAPMUIMonitorBlock monitorBlock;
@property (nonatomic, assign) double coldRebootBeginTime;

@property (class, nonatomic, assign) double mainStartTime;

+ (instancetype)sharedInstance;
+ (void)setup;
+ (void)setup:(Class)appDelegateClass;
- (void)startMonitor;

@end
Expand Down

0 comments on commit e26c647

Please sign in to comment.