Merge branch 'eagle-byte-apm' into dev_MogoAP_eagle-220_211207_8.0.15
# Conflicts: # app/build.gradle # app/src/main/java/com/mogo/launcher/MogoApplication.java # build.gradle # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt
This commit is contained in:
@@ -5,6 +5,8 @@ apply plugin: 'kotlin-android-extensions'
|
|||||||
apply plugin: 'android-aspectjx'
|
apply plugin: 'android-aspectjx'
|
||||||
apply plugin: 'bugly'
|
apply plugin: 'bugly'
|
||||||
//apply ByteX宿主
|
//apply ByteX宿主
|
||||||
|
apply plugin: 'apm-plugin'
|
||||||
|
////apply ByteX宿主
|
||||||
//apply plugin: 'bytex'
|
//apply plugin: 'bytex'
|
||||||
//ByteX {
|
//ByteX {
|
||||||
// enable true
|
// enable true
|
||||||
@@ -147,6 +149,27 @@ aspectjx {
|
|||||||
include "com.mogo.chat"
|
include "com.mogo.chat"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ApmPlugin {
|
||||||
|
// 是否进行插桩
|
||||||
|
enable true
|
||||||
|
// 是否在Debug包插桩,默认不插桩
|
||||||
|
enableInDebug true
|
||||||
|
// 启动分析开关:监控App启动耗时,需要同时开启pageLoadSwitch
|
||||||
|
startSwitch = true
|
||||||
|
// 页面响应开关:监控Activity的生命周期耗时
|
||||||
|
pageLoadSwitch = true
|
||||||
|
// 网络监控开关:监控okhttp3的网络请求
|
||||||
|
okHttp3Switch = true
|
||||||
|
// 白名单下的包进行插桩,需要填写要插装类所在的包名,支持前缀配置
|
||||||
|
whiteList = [
|
||||||
|
"com.mogo"
|
||||||
|
]
|
||||||
|
// 黑名单包下类不进行插桩,可以配置包名和类名,没有可以填空
|
||||||
|
blackList = [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||||
//Crash日志收集
|
//Crash日志收集
|
||||||
@@ -155,6 +178,9 @@ dependencies {
|
|||||||
implementation rootProject.ext.dependencies.arouter
|
implementation rootProject.ext.dependencies.arouter
|
||||||
implementation rootProject.ext.dependencies.boostmultidex
|
implementation rootProject.ext.dependencies.boostmultidex
|
||||||
|
|
||||||
|
implementation 'com.volcengine:apm_insight:1.4.4.cn'
|
||||||
|
implementation 'com.volcengine:apm_insight_crash:1.4.2'
|
||||||
|
|
||||||
implementation rootProject.ext.dependencies.mogologlib
|
implementation rootProject.ext.dependencies.mogologlib
|
||||||
compileOnly rootProject.ext.dependencies.adasapi
|
compileOnly rootProject.ext.dependencies.adasapi
|
||||||
compileOnly rootProject.ext.dependencies.adasconfigapi
|
compileOnly rootProject.ext.dependencies.adasconfigapi
|
||||||
|
|||||||
@@ -1,15 +1,42 @@
|
|||||||
package com.mogo.launcher;
|
package com.mogo.launcher;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Process;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.apm.applog.AppLog;
|
||||||
|
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.auto.zhidao.logsdk.CrashSystem;
|
||||||
|
import com.bytedance.apm.insight.ApmInsight;
|
||||||
|
import com.bytedance.apm.insight.ApmInsightInitConfig;
|
||||||
|
import com.bytedance.apm.insight.IDynamicParams;
|
||||||
|
import com.bytedance.boost_multidex.BoostMultiDex;
|
||||||
|
import com.mogo.cloud.httpdns.MogoHttpDnsConfig;
|
||||||
|
import com.mogo.cloud.httpdns.bean.HttpDnsSimpleLocation;
|
||||||
|
import com.mogo.cloud.passport.IMoGoTokenCallback;
|
||||||
|
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||||
|
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||||
|
import com.mogo.commons.AbsMogoApplication;
|
||||||
|
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||||
import com.mogo.commons.debug.DebugConfig;
|
import com.mogo.commons.debug.DebugConfig;
|
||||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||||
import com.mogo.eagle.core.function.main.MainMoGoApplication;
|
import com.mogo.eagle.core.function.main.MainMoGoApplication;
|
||||||
import com.mogo.module.v2x.utils.ObuConfig;
|
import com.mogo.module.v2x.utils.ObuConfig;
|
||||||
import com.mogo.test.crashreport.CrashReportConstants;
|
import com.mogo.test.crashreport.CrashReportConstants;
|
||||||
|
import com.mogo.test.crashreport.upgrade.UpgradeReportConstants;
|
||||||
|
import com.mogo.utils.CommonUtils;
|
||||||
|
import com.mogo.utils.ProcessUtils;
|
||||||
import com.mogo.utils.logger.LogLevel;
|
import com.mogo.utils.logger.LogLevel;
|
||||||
import com.mogo.utils.logger.Logger;
|
import com.mogo.utils.logger.Logger;
|
||||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author congtaowang
|
* @author congtaowang
|
||||||
* @since 2019-12-18
|
* @since 2019-12-18
|
||||||
@@ -17,11 +44,14 @@ import com.mogo.utils.storage.SharedPrefsMgr;
|
|||||||
* Launcher application
|
* Launcher application
|
||||||
*/
|
*/
|
||||||
public class MogoApplication extends MainMoGoApplication {
|
public class MogoApplication extends MainMoGoApplication {
|
||||||
|
private static final String BYTEAMP_APPID = "302368";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initCrashConfig() {
|
protected void initCrashConfig() {
|
||||||
CrashSystem crashSystem = CrashSystem.getInstance(this);
|
CrashSystem crashSystem = CrashSystem.getInstance(this);
|
||||||
crashSystem.init();
|
crashSystem.init();
|
||||||
|
initCrash();
|
||||||
|
initApmInsight();
|
||||||
//设置debug模式,日志不上传
|
//设置debug模式,日志不上传
|
||||||
// crashSystem.setDebug(BuildConfig.DEBUG);
|
// crashSystem.setDebug(BuildConfig.DEBUG);
|
||||||
}
|
}
|
||||||
@@ -31,6 +61,86 @@ public class MogoApplication extends MainMoGoApplication {
|
|||||||
Logger.init(BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF);
|
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");
|
||||||
|
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
|
@Override
|
||||||
protected void initCloudClientConfig() {
|
protected void initCloudClientConfig() {
|
||||||
// todo 使用旧Socket链路 true = 旧链路,false = 新链路
|
// todo 使用旧Socket链路 true = 旧链路,false = 新链路
|
||||||
|
|||||||
16
build.gradle
16
build.gradle
@@ -12,6 +12,14 @@ buildscript {
|
|||||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/jcenter' }
|
maven { url 'https://maven.aliyun.com/repository/jcenter' }
|
||||||
|
maven { url 'https://nexus.zhidaoauto.com/repository/maven-releases/' }
|
||||||
|
maven { url 'https://nexus.zhidaoauto.com/repository/maven-public/' }
|
||||||
|
maven {
|
||||||
|
url "https://artifact.bytedance.com/repository/Volcengine/"
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
url "https://artifact.bytedance.com/repository/byteX/"
|
||||||
|
}
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
}
|
}
|
||||||
@@ -23,6 +31,9 @@ buildscript {
|
|||||||
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.bytedance.android.byteX:base-plugin:0.3.0"
|
||||||
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
|
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
|
||||||
|
classpath 'com.volcengine:apm_insight_plugin:1.4.1'
|
||||||
|
// classpath "com.bytedance.android.byteX:base-plugin:0.3.0"
|
||||||
|
// classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
|
||||||
|
|
||||||
// classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true }
|
// classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true }
|
||||||
}
|
}
|
||||||
@@ -45,6 +56,11 @@ allprojects {
|
|||||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/jcenter' }
|
maven { url 'https://maven.aliyun.com/repository/jcenter' }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' }
|
||||||
|
maven { url 'http://nexus.zhidaoauto.com/repository/maven-public/' }
|
||||||
|
maven {
|
||||||
|
url "https://artifact.bytedance.com/repository/Volcengine/"
|
||||||
|
}
|
||||||
google()
|
google()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
|||||||
CallerHmiListenerManager.invokeCheckAutoPilotBtnListener(false)
|
CallerHmiListenerManager.invokeCheckAutoPilotBtnListener(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
startAutoPilot()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user