8.0.17 apm 修改
This commit is contained in:
@@ -3,7 +3,7 @@ apply plugin: 'com.alibaba.arouter'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'android-aspectjx'
|
||||
apply plugin: 'bugly'
|
||||
//apply plugin: 'bugly'
|
||||
apply plugin: 'apm-plugin'
|
||||
|
||||
//apply ByteX宿主
|
||||
@@ -18,10 +18,10 @@ ByteX {
|
||||
hooklog{
|
||||
enableLoggerToServer true
|
||||
}*/
|
||||
bugly {
|
||||
appId = 'ac71228f85' // 注册时分配的App ID
|
||||
appKey = '3c736249-d6be-4066-b577-b7a6dc975cf7' // 注册时分配的App Key
|
||||
}
|
||||
//bugly {
|
||||
// appId = 'ac71228f85' // 注册时分配的App ID
|
||||
// appKey = '3c736249-d6be-4066-b577-b7a6dc975cf7' // 注册时分配的App Key
|
||||
//}
|
||||
|
||||
Properties properties = new Properties();
|
||||
properties.load(project.rootProject.file("gradle.properties").newDataInputStream())
|
||||
@@ -181,9 +181,6 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
implementation rootProject.ext.dependencies.boostmultidex
|
||||
|
||||
implementation 'com.volcengine:apm_insight:1.4.4.cn'
|
||||
implementation 'com.volcengine:apm_insight_crash:1.4.2'
|
||||
|
||||
compileOnly rootProject.ext.dependencies.adasapi
|
||||
compileOnly rootProject.ext.dependencies.adasconfigapi
|
||||
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
package com.mogo.launcher;
|
||||
|
||||
import com.apm.insight.AttachUserData;
|
||||
import com.apm.insight.CrashType;
|
||||
import com.apm.insight.MonitorCrash;
|
||||
import com.apm.insight.log.VLog;
|
||||
import com.auto.zhidao.logsdk.CrashSystem;
|
||||
import com.bytedance.apm.insight.ApmInsight;
|
||||
import com.bytedance.apm.insight.ApmInsightInitConfig;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.main.MainMoGoApplication;
|
||||
@@ -19,9 +12,6 @@ import com.mogo.eagle.core.utilcode.util.CommonUtils;
|
||||
import com.mogo.module.v2x.utils.ObuConfig;
|
||||
import com.mogo.test.crashreport.CrashReportConstants;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-18
|
||||
@@ -29,14 +19,12 @@ import java.util.Map;
|
||||
* Launcher application
|
||||
*/
|
||||
public class MogoApplication extends MainMoGoApplication {
|
||||
private static final String BYTEAMP_APPID = "302368";
|
||||
|
||||
@Override
|
||||
protected void initCrashConfig() {
|
||||
CrashSystem crashSystem = CrashSystem.getInstance(this);
|
||||
crashSystem.init();
|
||||
initCrash();
|
||||
initApmInsight();
|
||||
|
||||
//设置debug模式,日志不上传
|
||||
// crashSystem.setDebug(BuildConfig.DEBUG);
|
||||
}
|
||||
@@ -46,91 +34,6 @@ public class MogoApplication extends MainMoGoApplication {
|
||||
Logger.init(BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF);
|
||||
}
|
||||
|
||||
private void initCrash() {
|
||||
|
||||
MonitorCrash crash = MonitorCrash.init(this, BYTEAMP_APPID, CommonUtils.getVersionCode(this), CommonUtils.getVersionName(this))
|
||||
.setCustomDataCallback(new AttachUserData() {
|
||||
@Override
|
||||
public Map<? extends String, ? extends String> getUserData(CrashType type) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
// map.put("app_custom", "app_value");
|
||||
//SN
|
||||
map.put("serial", MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
//地图版本
|
||||
String mapSDKVersion = AppUtils.getCustomMapSDKVersion(getApplicationContext());
|
||||
map.put("MAP_SDK_VERSION", mapSDKVersion);
|
||||
return map;
|
||||
}
|
||||
});
|
||||
crash.config().setChannel("eagle");
|
||||
// crash.config().setDeviceId("did");//可选,可以设置自定义did,不设置会使用内部默认的
|
||||
// crash.setReportUrl("www.xxx.com"); // 私有化部署:私有化部署才配置上报地址
|
||||
// crash.addTags("key", "value"); // 自定义筛选tag, 按需添加、可多次覆盖
|
||||
}
|
||||
|
||||
/**
|
||||
* ApmInsight性能监控初始化
|
||||
*/
|
||||
private void initApmInsight() {
|
||||
|
||||
ApmInsightInitConfig.Builder builder = ApmInsightInitConfig.builder();
|
||||
//设置分配的appid
|
||||
builder.aid(BYTEAMP_APPID);
|
||||
//是否开启卡顿功能
|
||||
builder.blockDetect(true);
|
||||
//是否开启严重卡顿功能
|
||||
builder.seriousBlockDetect(true);
|
||||
//是否开启流畅性和丢帧
|
||||
builder.fpsMonitor(true);
|
||||
//控制是否打开WebVeiw监控
|
||||
builder.enableWebViewMonitor(true);
|
||||
//控制是否打开内存监控
|
||||
builder.memoryMonitor(true);
|
||||
//控制是否打开电量监控
|
||||
builder.batteryMonitor(true);
|
||||
//是否打印日志,注:线上release版本要配置为false
|
||||
builder.debugMode(true);
|
||||
//支持用户自定义user_id把平台数据和自己用户关联起来,可以不配置
|
||||
// builder.userId("user_id");
|
||||
//私有化部署:配置数据上报的域名 (私有化部署才需要配置,内部有默认域名),测试支持设置http://www.xxx.com 默认是https协议
|
||||
// builder.defaultReportDomain("www.xxx.com");
|
||||
//设置渠道。1.3.16版本增加接口
|
||||
builder.channel("local");
|
||||
//打开自定义日志回捞能力,1.4.1版本新增接口
|
||||
builder.enableLogRecovery(true);
|
||||
//设置数据和Rangers Applog数据打通,设备标识did必填。1.3.16版本增加接口
|
||||
// builder.setDynamicParams(new IDynamicParams() {
|
||||
// @Override
|
||||
// public String getUserUniqueID() {
|
||||
// //可选。依赖AppLog可以通过AppLog.getUserUniqueID()获取,否则可以返回null。
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getAbSdkVersion() {
|
||||
// //可选。如果依赖AppLog可以通过AppLog.getAbSdkVersion()获取,否则可以返回null。
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getSsid() {
|
||||
// //可选。依赖AppLog可以通过AppLog.getSsid()获取,否则可以返回null。
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getDid() {
|
||||
// //1.4.0版本及以上,可选,其他版本必填。设备的唯一标识,如果依赖AppLog可以通过 AppLog.getDid() 获取,也可以自己生成。
|
||||
// return AppLog.getDid();
|
||||
// }
|
||||
// });
|
||||
ApmInsight.getInstance().init(this, builder.build());
|
||||
|
||||
//初始化自定日志,配置自定义日志最大占用磁盘,内部一般配置20,代表最大20M磁盘占用。1.4.1版本开始存在这个api
|
||||
VLog.init(this, 20);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initCloudClientConfig() {
|
||||
// todo 使用旧Socket链路 true = 旧链路,false = 新链路
|
||||
|
||||
@@ -28,7 +28,7 @@ buildscript {
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31'
|
||||
classpath "com.alibaba:arouter-register:1.0.12-mogo"
|
||||
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
|
||||
classpath 'com.tencent.bugly:symtabfileuploader:latest.release'
|
||||
// classpath 'com.tencent.bugly:symtabfileuploader:latest.release'
|
||||
classpath "com.bytedance.android.byteX:base-plugin:0.3.0"
|
||||
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
|
||||
classpath 'com.volcengine:apm_insight_plugin:1.4.1'
|
||||
|
||||
@@ -195,6 +195,9 @@ ext {
|
||||
skinsupportcardview : "com.mogo.skin:skin-support-cardview:${SKIN_SUPPORT_CARDVIEW_VERSION}",
|
||||
skinsupportconstraintlayout : "com.mogo.skin:skin-support-constraint-layout:${SKIN_SUPPORT_CONSTRAINT_LAYOUT_VERSION}",
|
||||
skinsupportdesign : "com.mogo.skin:skin-support-design:${SKIN_SUPPORT_DESIGN_VERSION}",
|
||||
apm_insight : 'com.volcengine:apm_insight:1.4.4.cn',
|
||||
apm_insight_crash : 'com.volcengine:apm_insight_crash:1.4.2',
|
||||
|
||||
//========================= TTS语音 Maven 版本管理 =========================
|
||||
ttsbase : "com.mogo.tts:tts-base:${TTS_BASE_VERSION}",
|
||||
ttsdi : "com.mogo.tts:tts-di:${TTS_DI_VERSION}",
|
||||
|
||||
@@ -113,6 +113,7 @@ dependencies {
|
||||
api project(':libraries:map-custom')
|
||||
api project(':test:crashreport-upgrade')
|
||||
// api project(':test:crashreport-bugly')
|
||||
api project(':test:crashreport-apmbyte')
|
||||
api project(':modules:mogo-module-service')
|
||||
|
||||
api project(':core:mogo-core-data')
|
||||
|
||||
@@ -424,6 +424,11 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void setMapDAngle(float angle) {
|
||||
//
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void clearRoadCacheById(String id) {
|
||||
initDelegate();
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
:modules:mogo-module-carchatting
|
||||
:test:crashreport
|
||||
:test:crashreport-bugly
|
||||
:test:crashreport-apm
|
||||
:test:crashreport-noop
|
||||
:test:crashreport-upgrade
|
||||
:core:function-impl:mogo-core-function-obu-mogo
|
||||
|
||||
@@ -83,4 +83,4 @@ include ':test:crashreport'
|
||||
include ':test:crashreport-bugly'
|
||||
include ':test:crashreport-noop'
|
||||
include ':test:crashreport-upgrade'
|
||||
|
||||
include ':test:crashreport-apmbyte'
|
||||
|
||||
1
test/crashreport-apmbyte/.gitignore
vendored
Normal file
1
test/crashreport-apmbyte/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
65
test/crashreport-apmbyte/build.gradle
Normal file
65
test/crashreport-apmbyte/build.gradle
Normal file
@@ -0,0 +1,65 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-android-extensions'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.alibaba.arouter'
|
||||
}
|
||||
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode Integer.valueOf(VERSION_CODE)
|
||||
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
|
||||
|
||||
ndk {
|
||||
// 设置支持的SO库架构
|
||||
abiFilters 'armeabi' //, 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
|
||||
}
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
|
||||
//ARouter apt 参数
|
||||
kapt {
|
||||
useBuildCache = false
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.apm_insight_crash
|
||||
implementation rootProject.ext.dependencies.apm_insight
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
api rootProject.ext.dependencies.crashreport
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
} else {
|
||||
api project(":test:crashreport")
|
||||
implementation project(":foudations:mogo-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
0
test/crashreport-apmbyte/consumer-rules.pro
Normal file
0
test/crashreport-apmbyte/consumer-rules.pro
Normal file
3
test/crashreport-apmbyte/gradle.properties
Normal file
3
test/crashreport-apmbyte/gradle.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
GROUP=com.mogo.test
|
||||
POM_ARTIFACT_ID=crashreport-bugly
|
||||
VERSION_CODE=1
|
||||
21
test/crashreport-apmbyte/proguard-rules.pro
vendored
Normal file
21
test/crashreport-apmbyte/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
5
test/crashreport-apmbyte/src/main/AndroidManifest.xml
Normal file
5
test/crashreport-apmbyte/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.test.crashreport.apm">
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.mogo.test.crashreport.apm;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.apm.insight.AttachUserData;
|
||||
import com.apm.insight.CrashType;
|
||||
import com.apm.insight.MonitorCrash;
|
||||
import com.apm.insight.log.VLog;
|
||||
import com.bytedance.apm.insight.ApmInsight;
|
||||
import com.bytedance.apm.insight.ApmInsightInitConfig;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.test.crashreport.CrashReportConstants;
|
||||
import com.mogo.test.crashreport.ITestCrashReportProvider;
|
||||
import com.mogo.utils.AppUtils;
|
||||
import com.mogo.utils.CommonUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/9
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Route(path = CrashReportConstants.PATH)
|
||||
public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
private static final String BYTEAMP_APPID = "302368";
|
||||
|
||||
private static final String TAG = "ApmCrashReportProvider";
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Logger.d(TAG, "init");
|
||||
initCrash(context);
|
||||
initApmInsight(context);
|
||||
}
|
||||
private void initCrash(final Context context) {
|
||||
|
||||
MonitorCrash crash = MonitorCrash.init(context, BYTEAMP_APPID, CommonUtils.getVersionCode(context), CommonUtils.getVersionName(context))
|
||||
.setCustomDataCallback(new AttachUserData() {
|
||||
@Override
|
||||
public Map<? extends String, ? extends String> getUserData(CrashType type) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
//地图版本
|
||||
String mapSDKVersion = AppUtils.getCustomMapSDKVersion(context);
|
||||
map.put("MAP_SDK_VERSION", mapSDKVersion);
|
||||
return map;
|
||||
}
|
||||
});
|
||||
crash.config().setChannel("eagle");
|
||||
crash.config().setDeviceId(MoGoAiCloudClientConfig.getInstance().getSn());//可选,可以设置自定义did,不设置会使用内部默认的
|
||||
// crash.setReportUrl("www.xxx.com"); // 私有化部署:私有化部署才配置上报地址
|
||||
// crash.addTags("key", "value"); // 自定义筛选tag, 按需添加、可多次覆盖
|
||||
}
|
||||
|
||||
/**
|
||||
* ApmInsight性能监控初始化
|
||||
*/
|
||||
private void initApmInsight(Context context) {
|
||||
|
||||
ApmInsightInitConfig.Builder builder = ApmInsightInitConfig.builder();
|
||||
//设置分配的appid
|
||||
builder.aid(BYTEAMP_APPID);
|
||||
//是否开启卡顿功能
|
||||
builder.blockDetect(true);
|
||||
//是否开启严重卡顿功能
|
||||
builder.seriousBlockDetect(true);
|
||||
//是否开启流畅性和丢帧
|
||||
builder.fpsMonitor(true);
|
||||
//控制是否打开WebVeiw监控
|
||||
builder.enableWebViewMonitor(true);
|
||||
//控制是否打开内存监控
|
||||
builder.memoryMonitor(true);
|
||||
//控制是否打开电量监控
|
||||
builder.batteryMonitor(true);
|
||||
//是否打印日志,注:线上release版本要配置为false
|
||||
builder.debugMode(true);
|
||||
//支持用户自定义user_id把平台数据和自己用户关联起来,可以不配置
|
||||
// builder.userId("user_id");
|
||||
//私有化部署:配置数据上报的域名 (私有化部署才需要配置,内部有默认域名),测试支持设置http://www.xxx.com 默认是https协议
|
||||
// builder.defaultReportDomain("www.xxx.com");
|
||||
//设置渠道。1.3.16版本增加接口
|
||||
builder.channel("local");
|
||||
//打开自定义日志回捞能力,1.4.1版本新增接口
|
||||
builder.enableLogRecovery(true);
|
||||
//设置数据和Rangers Applog数据打通,设备标识did必填。1.3.16版本增加接口
|
||||
// builder.setDynamicParams(new IDynamicParams() {
|
||||
// @Override
|
||||
// public String getUserUniqueID() {
|
||||
// //可选。依赖AppLog可以通过AppLog.getUserUniqueID()获取,否则可以返回null。
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getAbSdkVersion() {
|
||||
// //可选。如果依赖AppLog可以通过AppLog.getAbSdkVersion()获取,否则可以返回null。
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getSsid() {
|
||||
// //可选。依赖AppLog可以通过AppLog.getSsid()获取,否则可以返回null。
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getDid() {
|
||||
// //1.4.0版本及以上,可选,其他版本必填。设备的唯一标识,如果依赖AppLog可以通过 AppLog.getDid() 获取,也可以自己生成。
|
||||
// return AppLog.getDid();
|
||||
// }
|
||||
// });
|
||||
ApmInsight.getInstance().init(context, builder.build());
|
||||
|
||||
//初始化自定日志,配置自定义日志最大占用磁盘,内部一般配置20,代表最大20M磁盘占用。1.4.1版本开始存在这个api
|
||||
VLog.init(context, 20);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.io.IOException;
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Route(path = CrashReportConstants.PATH)
|
||||
//@Route(path = CrashReportConstants.PATH)
|
||||
public class BuglyCrashReportProvider implements ITestCrashReportProvider {
|
||||
|
||||
private static final String TAG = "BuglyCrashReportProvider";
|
||||
|
||||
Reference in New Issue
Block a user