[Feat]第一阶段初始化时间加入链路日志中

This commit is contained in:
chenfufeng
2022-06-06 15:43:24 +08:00
parent 1070a27b34
commit 5cdb57ae80
5 changed files with 56 additions and 5 deletions

View File

@@ -1,5 +1,8 @@
package com.mogo.eagle.core.function.main;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_START_UP;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_INIT;
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.content.Intent;
@@ -22,6 +25,14 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.BarUtils;
import com.mogo.service.intent.IMogoIntentListener;
import com.rousetime.android_startup.model.CostTimesModel;
import com.zhjt.service.chain.ChainLog;
import com.zhjt.service.chain.TracingConstants;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.List;
/**
* 针对作为Launcher的情况做个性化操作
@@ -38,6 +49,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
DebugConfig.setNeedRequestUserInfo(true);
EventBus.getDefault().register(this);
CallerLogger.INSTANCE.i(M_HMI + TAG, "onCreate");
}
@@ -101,6 +113,26 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
}
}
@Subscribe(sticky = true)
public void handleStartUp(List<CostTimesModel> costTimesModels) {
for (CostTimesModel costModel : costTimesModels) {
traceStartUp(costModel.toString());
}
EventBus.getDefault().removeStickyEvent(costTimesModels);
}
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS,
linkCode = CHAIN_LINK_INIT,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_START_UP,
paramIndexes = {0},
clientPkFileName = "sn"
)
private void traceStartUp(String content) {
CallerLogger.INSTANCE.d(M_HMI + TAG, content);
}
@Override
protected void onDestroy() {
super.onDestroy();
@@ -113,6 +145,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
}
// 移除换肤监听
CallerSkinModeListenerManager.INSTANCE.removeListener(TAG);
EventBus.getDefault().unregister(this);
}
private void stopCountDown() {