pod 'JDDApm', :http => 'https://static-resources.s3.cn-north-1.jdcloud-oss.com/sgm/mobile/JDDApm-0.3.97.zip', :type => 'zip'
先下载SDK的ZIP文件并解压 pod 'JDDApm', :path=> 'zip解压后所在的目录'
将ZIP文件解压后,根据需要移动到项目目录下,添加iOS SDK依赖
pod 'JDDApm', :path=> 'ZIP解压后所在的目录'
FMDB
RealReachability
#import <JDDApm/JRApmSDK.h>
//全部功能打开
int64_t optionSwitch = JDDAPM_OPTION_ALL;
JDDApmPrivacyConfig *config = [[JDDApmPrivacyConfig alloc] init];
config.optionSwitch = optionSwitch;
config.deviceID = DEVICEID;//设备唯一ID
config.appkey = @"${appkey}";
config.appSecret = @"${appSecret}";
config.hostURLString = @"${hostURL}";
config.userIDBlock = ^NSString *{
return userID;
};
BOOL initSuccess = [JRApmSDK setupConfiguration:config];
if (!initSuccess) {
//没有初始化成功
NSLog(@“初始化sgm失败”);
}else{
NSLog(@“初始化sgm成功”);
}
[JRApmSDK setIgnoreNetworkUrlBlock:^BOOL(NSURL *requestUrl) {
if ([requestUrl.absoluteString containsString:@".jdcloud.com"]) {
//由于数据采集的网路量较大,忽略监控
return YES;
}
return NO;
}];
接入SDK后默认会采集一条标准的启动时长,从用户点击图标到进入首个可见页面的总时长。
[JRApmSDK recordPerformanceCustomStart:customKey];//记录 自定义性能监控 开始时间
[JRApmSDK recordPerformanceCustomEnd:customKey];//记录 自定义性能监控 开始时间
//标准的启动日志中会追加一条此自定义采集启动时间
GLobalRealReachability.hostForPing = www.jd.com;
[GLobalRealReachability startNotifier];
我们的产品专家为您找到最合适的产品/解决⽅案
1v1线上咨询获取售前专业咨询
专业产品顾问,随时随地沟通