[2.12.0] taxi-d/-p /bus-d 增加启动自驾失败埋点

This commit is contained in:
wangmingjun
2022-11-09 18:30:39 +08:00
parent 6732ed9a00
commit 3035d2ba86
8 changed files with 69 additions and 5 deletions

View File

@@ -63,6 +63,7 @@ class BusConst {
const val EVENT_PARAM_END_NAME = "end_name"
const val EVENT_PARAM_LINE_ID = "line_id"
const val EVENT_PARAM_START_RESULT = "start_autopilot" // true/false
const val EVENT_PARAM_START_FAILURE_MSG = "start_autopilot_failure_msg" // 启动自驾失败原因
const val EVENT_PARAM_PLATE_NUM = "plate_number" // 车牌号
const val EVENT_PARAM_ENV_ONLINE = "env_online" // 是否线上环境true/false
// 埋点key开启自动驾驶前已识别的异常会导致无法开启自驾

View File

@@ -11,9 +11,9 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.bus.constant.BusConst;
import com.mogo.och.common.module.manager.OCHAdasAbilityManager;
import java.util.HashMap;
import java.util.Map;
/**
* OCH Bus埋点工具
@@ -40,6 +40,8 @@ public class BusAnalyticsManager {
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_RESULT
, CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() ==
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_FAILURE_MSG,
OCHAdasAbilityManager.getInstance().getStartFailedMessage());
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
};

View File

@@ -6,9 +6,12 @@ import androidx.annotation.Nullable;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatisticsListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.zhidao.support.adas.high.bean.AutopilotAbility;
import com.zhidao.support.adas.high.bean.AutopilotStatistics;
import chassis.Chassis;
import system_master.SystemStatusInfo;
@@ -18,12 +21,13 @@ import system_master.SystemStatusInfo;
* 工控机状态信息回调(判断是否能否启动自动驾驶的回调)
* 目前定的是3秒回调一次
*/
public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener {
public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMoGoAutopilotStatisticsListener {
private static final String TAG = OCHAdasAbilityManager.class.getSimpleName();
private boolean isAutopilotAbility = true;
private String autopilotAbilityReason = "";
private String startFailedMessage = "";
private static final class SingletonHolder {
private static final OCHAdasAbilityManager INSTANCE = new OCHAdasAbilityManager();
@@ -45,13 +49,19 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener {
return autopilotAbilityReason;
}
public String getStartFailedMessage() {
return startFailedMessage;
}
private void initListeners() {
//2022.10.9 工控机状态信息回调(判断是否能否启动自动驾驶的回调), 目前定的是3秒回调一次
CallerAutopilotActionsListenerManager.INSTANCE.addListener(TAG, this);
CallerAutopilotStatisticsListenerManager.INSTANCE.addListener(TAG,this);
}
private void releaseListeners() {
CallerAutopilotActionsListenerManager.INSTANCE.removeListener(this);
CallerAutopilotStatisticsListenerManager.INSTANCE.removeListener(this);
}
@Override
@@ -88,6 +98,14 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener {
Logger.d(TAG, "是否可以启动自动驾驶=" + isAutopilotAbility + " 原因=" + autopilotAbilityReason);
}
@Override
public void onAutopilotStatistics(@Nullable AutopilotStatistics statistics) {
if (1 == statistics.status || 3 == statistics.status){ //失败、超时
startFailedMessage = statistics.failedMessage.getMsg();
}
}
public void release() {
releaseListeners();
}

View File

@@ -58,5 +58,9 @@ class TaxiPassengerConst {
const val EVENT_PARAM_START_RESULT = "start_autopilot" // true/false
const val EVENT_PARAM_PLATE_NUM = "plate_number" // 车牌号
const val EVENT_PARAM_ENV_ONLINE = "env_online" // 是否线上环境true/false
// 埋点key开启自动驾驶前已识别的异常会导致无法开启自驾
const val EVENT_KEY_AP_UNABLE_START_REASON = "event_key_och_taxi_ap_unable_start_reason"
const val EVENT_PARAM_UNABLE_START_REASON = "unable_start_reason";
}
}

View File

@@ -33,6 +33,7 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.och.common.module.manager.OCHAdasAbilityManager;
import com.mogo.och.common.module.map.AmapNaviToDestinationModel;
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
@@ -925,6 +926,16 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
startServicePilotDone();
}
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
", 请稍候重试");
TaxiPassengerAnalyticsManager.getInstance().triggerUnableStartAPReasonEvent(
mCurrentOCHOrder.startSiteAddr, mCurrentOCHOrder.endSiteAddr, mCurrentOCHOrder.orderNo,
OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason());
return;
}
double startWgsLon = mCurrentOCHOrder.startSitePoint.get(0);
double startWgsLat = mCurrentOCHOrder.startSitePoint.get(1);
double endWgsLon = mCurrentOCHOrder.endSitePoint.get(0);

View File

@@ -74,4 +74,31 @@ public class TaxiPassengerAnalyticsManager {
UiThreadHandler.postDelayed(startAutopilotRunnable, TaxiPassengerConst.LOOP_PERIOD_15S);
}
}
/**
* 触发"无法开启自驾已知异常"埋点
* @param startName
* @param endName
* @param orderNo
*/
public void triggerUnableStartAPReasonEvent(String startName, String endName, String orderNo,
String reason) {
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
String plateNum = AppConfigInfo.INSTANCE.getPlateNumber();
String dateTime = DateTimeUtils.getTimeText(
System.currentTimeMillis(), DateTimeUtils.yyyy_MM_dd_HH_mm_ss);
HashMap<String, Object> params = new HashMap<>();
params.put(TaxiPassengerConst.EVENT_PARAM_SN, sn);
params.put(TaxiPassengerConst.EVENT_PARAM_PLATE_NUM, TextUtils.isEmpty(plateNum) ? "" : plateNum);
params.put(TaxiPassengerConst.EVENT_PARAM_ENV_ONLINE,
DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE ? true : false);
params.put(TaxiPassengerConst.EVENT_PARAM_TIME, dateTime);
params.put(TaxiPassengerConst.EVENT_PARAM_START_NAME, startName);
params.put(TaxiPassengerConst.EVENT_PARAM_END_NAME, endName);
params.put(TaxiPassengerConst.EVENT_PARAM_ORDER_NUMBER, orderNo);
params.put(TaxiPassengerConst.EVENT_PARAM_UNABLE_START_REASON, reason);
AnalyticsManager.INSTANCE.track(TaxiPassengerConst.EVENT_KEY_AP_UNABLE_START_REASON, params);
}
}

View File

@@ -65,6 +65,7 @@ class TaxiConst {
const val EVENT_PARAM_END_NAME = "end_name"
const val EVENT_PARAM_ORDER_NUMBER = "order_num"
const val EVENT_PARAM_START_RESULT = "start_autopilot" // true/false
const val EVENT_PARAM_START_FAILURE_MSG = "start_autopilot_failure_msg" // 启动自驾失败原因
const val EVENT_PARAM_PLATE_NUM = "plate_number" // 车牌号
const val EVENT_PARAM_ENV_ONLINE = "env_online" // 是否线上环境true/false
// 埋点key开启自动驾驶前已识别的异常会导致无法开启自驾

View File

@@ -1,16 +1,14 @@
package com.mogo.och.taxi.utils;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI;
import android.text.TextUtils;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.app.AppConfigInfo;
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.common.module.manager.OCHAdasAbilityManager;
import com.mogo.och.taxi.constant.TaxiConst;
import java.util.HashMap;
@@ -38,6 +36,8 @@ public class TaxiAnalyticsManager {
private Runnable startAutopilotRunnable = () -> {
// 15s内未开启上报失败埋点
mStartAutopilotParams.put(TaxiConst.EVENT_PARAM_START_RESULT, false);
mStartAutopilotParams.put(TaxiConst.EVENT_PARAM_START_FAILURE_MSG,
OCHAdasAbilityManager.getInstance().getStartFailedMessage());
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
};