[2.12.6]启动自驾失败埋点优化:增加code

This commit is contained in:
pangfan
2022-12-08 18:38:05 +08:00
committed by wangmingjun
parent 1a1f808456
commit 8363e4eb11
8 changed files with 29 additions and 17 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_CODE = "start_autopilot_failure_code" // 启动自驾失败code
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

View File

@@ -68,6 +68,8 @@ import com.mogo.och.common.module.utils.PinYinUtil;
import com.mogo.och.common.module.utils.ToastUtilsOch;
import com.mogo.och.common.module.voice.VoiceNotice;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -369,8 +371,8 @@ public class BusOrderModel {
private final OchAdasStartFailureCallback mAdasStartFailureListener = new OchAdasStartFailureCallback() {
@Override
public void onStartAutopilotFailure(@NonNull String startFailedMessage) {
BusAnalyticsManager.getInstance().triggerStartAutopilotFailureEventByAdas(startFailedMessage);
public void onStartAutopilotFailure(@NotNull String startFailedCode, @NonNull String startFailedMessage) {
BusAnalyticsManager.getInstance().triggerStartAutopilotFailureEventByAdas(startFailedCode, startFailedMessage);
if (mADASStatusCallback != null && !FunctionBuildConfig.isDemoMode){
CallerLogger.INSTANCE.e( M_BUS + TAG, "mAdasStartFailureListener = "+startFailedMessage );
mADASStatusCallback.onStartAdasFailure();

View File

@@ -38,21 +38,21 @@ public class BusAnalyticsManager {
private Runnable startAutopilotRunnable = () -> {
// 15s内未开启上报失败埋点
triggerStartAutopilotFailureEvent("15s后app等待超时");
triggerStartAutopilotFailureEvent("", "15s后app等待超时");
};
public void triggerStartAutopilotFailureEventByAdas(String failMsg){
public void triggerStartAutopilotFailureEventByAdas(String failCode, String failMsg){
removeWaitingCallback();
triggerStartAutopilotFailureEvent(failMsg);
triggerStartAutopilotFailureEvent(failCode, failMsg);
}
private void triggerStartAutopilotFailureEvent(String failMsg){
private void triggerStartAutopilotFailureEvent(String failCode, String failMsg){
CallerLogger.INSTANCE.e( M_BUS + "triggerStartAutopilotFailureEvent", failMsg );
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_RESULT
, CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() ==
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_FAILURE_MSG,
failMsg);
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_FAILURE_CODE, failCode);
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_FAILURE_MSG, failMsg);
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
}

View File

@@ -5,5 +5,5 @@ package com.mogo.och.common.module.callback
* @date: 2022/11/9
*/
interface OchAdasStartFailureCallback {
fun onStartAutopilotFailure(startFailedMessage : String)
fun onStartAutopilotFailure(startFailedCode : String, startFailedMessage : String)
}

View File

@@ -28,6 +28,7 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
private boolean isAutopilotAbility = true;
private String autopilotAbilityReason = "";
private String startFailedCode = "";
private String startFailedMessage = "";
private OchAdasStartFailureCallback failureCallback = null;
@@ -56,6 +57,10 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
return autopilotAbilityReason;
}
public String getStartFailedCode() {
return startFailedCode;
}
public String getStartFailedMessage() {
return startFailedMessage;
}
@@ -111,9 +116,11 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
if (statistics == null) return;
Logger.d(TAG, "AutopilotStatistics= " + statistics.status);
if (failureCallback != null && 1 == statistics.status){
startFailedCode = statistics.failedMessage.getCode();
startFailedMessage = statistics.failedMessage.getMsg();
failureCallback.onStartAutopilotFailure(startFailedMessage);
Logger.d(TAG, "statistics-startFailedMessage= " + startFailedMessage);
failureCallback.onStartAutopilotFailure(startFailedCode, startFailedMessage);
Logger.d(TAG, String.format("statistics-startFailedCode = s%; startFailedMessage = s%",
startFailedCode, startFailedMessage));
}
}

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_CODE = "start_autopilot_failure_code" // 启动自驾失败code
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

View File

@@ -1030,8 +1030,8 @@ public class TaxiModel {
private final OchAdasStartFailureCallback mAdasStartFailureListener = new OchAdasStartFailureCallback() {
@Override
public void onStartAutopilotFailure(@NonNull String startFailedMessage) {
TaxiAnalyticsManager.getInstance().triggerStartAutopilotFailureEventByAdas(startFailedMessage);
public void onStartAutopilotFailure(@NotNull String startFailedCode, @NonNull String startFailedMessage) {
TaxiAnalyticsManager.getInstance().triggerStartAutopilotFailureEventByAdas(startFailedCode, startFailedMessage);
if (mADASStatusCallback != null && !FunctionBuildConfig.isDemoMode){
CallerLogger.INSTANCE.e(M_TAXI + TAG, "mAdasStartFailureListener = "+startFailedMessage);
mADASStatusCallback.onStartAdasFailure();

View File

@@ -36,12 +36,12 @@ public class TaxiAnalyticsManager {
private Runnable startAutopilotRunnable = () -> {
// 15s内未开启上报失败埋点
triggerStartAutopilotFailureEvent("15s后app等待超时");
triggerStartAutopilotFailureEvent("", "15s后app等待超时");
};
public void triggerStartAutopilotFailureEventByAdas(String failMsg){
public void triggerStartAutopilotFailureEventByAdas(String failCode, String failMsg){
removeWaitingCallback();
triggerStartAutopilotFailureEvent(failMsg);
triggerStartAutopilotFailureEvent(failCode, failMsg);
}
private void removeWaitingCallback() {
@@ -51,9 +51,10 @@ public class TaxiAnalyticsManager {
}
}
private void triggerStartAutopilotFailureEvent(String failMsg){
private void triggerStartAutopilotFailureEvent(String failCode, String failMsg){
CallerLogger.INSTANCE.e(M_TAXI + "triggerStartAutopilotFailureEvent", failMsg);
mStartAutopilotParams.put(TaxiConst.EVENT_PARAM_START_RESULT, false);
mStartAutopilotParams.put(TaxiConst.EVENT_PARAM_START_FAILURE_CODE, failCode);
mStartAutopilotParams.put(TaxiConst.EVENT_PARAM_START_FAILURE_MSG,
failMsg);
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);