[6.6.0]
1、增加Okhttp网络请求每个节点的日志回调 2、修改Okhttp的超时时间为总体20秒 CONNECT_TIMEOUT = 10000L READ_TIMEOUT = 5000L WRITE_TIMEOUT = 5000L
This commit is contained in:
@@ -177,9 +177,9 @@ class DevaToolsProvider : IDevaToolsProvider, IAppStateListener {
|
||||
BadCaseManager.init(mContext!!)
|
||||
if (DebugConfig.isDebug()) {
|
||||
SdtManager.init(mContext!!, true, DetectResultImpl())
|
||||
// 监听弱网
|
||||
WeakNetworkStrategy.startListen()
|
||||
}
|
||||
// 监听弱网
|
||||
WeakNetworkStrategy.startListen()
|
||||
lookAroundDataProvider.init(mContext!!)
|
||||
(mContext as? Application)?.also {
|
||||
mofangProvider.init(it)
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.zhjt.mogo_core_function_devatools.weaknetwork
|
||||
import android.util.Log
|
||||
import com.mogo.cloud.network.WeakNetworkManager
|
||||
import com.mogo.cloud.network.WeakNetworkManager.setListener
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
@@ -10,6 +11,7 @@ import com.mogo.weak.network.SdtManager
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock
|
||||
|
||||
|
||||
object WeakNetworkStrategy {
|
||||
|
||||
private const val TAG = "WeakNetworkStrategy"
|
||||
@@ -19,7 +21,8 @@ object WeakNetworkStrategy {
|
||||
|
||||
private const val WEAK_HTTP_RTT = 1300
|
||||
|
||||
private const val VERY_CONSUMING_TIME_URL = "/yycp-launcherSnapshot/launcherSnapshot/querySnapshotSync"
|
||||
private const val VERY_CONSUMING_TIME_URL =
|
||||
"/yycp-launcherSnapshot/launcherSnapshot/querySnapshotSync"
|
||||
|
||||
private var lastOutputTime = 0L
|
||||
|
||||
@@ -41,16 +44,34 @@ object WeakNetworkStrategy {
|
||||
setListener(object : WeakNetworkManager.OnWeakHttpListener {
|
||||
override fun onHttpRttReceived(hashCode: Int, url: String, timeStamp: Long) {
|
||||
if (VERY_CONSUMING_TIME_URL in url) return
|
||||
outputLog(url, timeStamp)
|
||||
//outputLog(url, timeStamp)
|
||||
}
|
||||
|
||||
override fun onFailEvent(hashCode: Int, url: String, timeStamp: Long, currentFailCount: Long) {
|
||||
outputLog(url, timeStamp, true)
|
||||
override fun onFailEvent(
|
||||
hashCode: Int,
|
||||
url: String,
|
||||
timeStamp: Long,
|
||||
currentFailCount: Long
|
||||
) {
|
||||
//outputLog(url, timeStamp, true)
|
||||
}
|
||||
|
||||
override fun onWeakNetworkEvent() {
|
||||
// // 大而全接口干扰,需排除掉
|
||||
// Log.d(TAG, "收到弱网事件!")
|
||||
// 大而全接口干扰,需排除掉
|
||||
//Log.d(TAG, "收到弱网事件!")
|
||||
}
|
||||
|
||||
override fun logMethod(name: String, startTime: Long) {
|
||||
ToastUtils.showShort("当前网络质量差!")
|
||||
|
||||
// 网络质量差的请求上报埋点
|
||||
val elapsedTime: Long = System.nanoTime() - startTime
|
||||
val properties: MutableMap<String, Any> = HashMap()
|
||||
properties["http_request"] = name
|
||||
properties["http_request_start_time"] = startTime
|
||||
properties["http_request_elapsed_time"] = elapsedTime
|
||||
|
||||
MogoAnalyticUtils.track("http_net_status", properties)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -64,21 +64,21 @@ bytex.ASM_API=ASM7
|
||||
LOGLIB_VERSION=1.10.18
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 网络请求LOGLIB_VERSION
|
||||
MOGO_NETWORK_VERSION=1.4.7.33
|
||||
MOGO_NETWORK_VERSION=1.4.7.35
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.4.7.33
|
||||
MOGO_PASSPORT_VERSION=1.4.7.35
|
||||
# 长链接
|
||||
MOGO_SOCKET_VERSION=1.4.7.33
|
||||
MOGO_SOCKET_VERSION=1.4.7.35
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.4.7.33
|
||||
MOGO_REALTIME_VERSION=1.4.7.35
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.4.7.33
|
||||
MOGO_LIVE_VERSION=1.4.7.35
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.4.7.33
|
||||
MOGO_TRAFFICLIVE_VERSION=1.4.7.35
|
||||
# 定位服务
|
||||
MOGO_LOCATION_VERSION=1.4.7.33
|
||||
MOGO_LOCATION_VERSION=1.4.7.35
|
||||
# 远程通讯模块
|
||||
MOGO_TELEMATIC_VERSION=1.4.7.33
|
||||
MOGO_TELEMATIC_VERSION=1.4.7.35
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=3.4.0.6
|
||||
|
||||
Reference in New Issue
Block a user