xugenyuan

ref |> 集成接入听云APM SDK

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -59,3 +59,5 @@ export { UmengStats } from "./src/main/ets/umeng/UmengStats"
export { MpaasUtils } from './src/main/ets/mpaas/MpaasUtils'
export { MpaasUpgradeCheck, UpgradeTipContent } from './src/main/ets/mpaas/MpaasUpgradeCheck'
export { TingyunAPM } from './src/main/ets/tingyunAPM/TingyunAPM'
\ No newline at end of file
... ...
... ... @@ -7,6 +7,7 @@
"main": "Index.ets",
"version": "1.0.0",
"dependencies": {
"@tingyun/harmonyos": "file:./src/main/ets/tingyunAPM/tingyun_0.0.6.har",
"@umeng/common": "^1.0.21",
"@umeng/analytics": "^1.0.19"
}
... ...
import { common } from '@kit.AbilityKit';
import tingyun, { LogLevel } from '@tingyun/harmonyos';
export class TingyunAPM {
private static TINGYUN_APP_KEY = "" //TODO:
private static TINGYUN_REDIRECT_HOST = "wkrt.tingyun.com"
private static logEnable() {
return true
}
//
static initApp(context: common.UIAbilityContext, deviceId?: string) {
tingyun.init({
redirectHost: TingyunAPM.TINGYUN_REDIRECT_HOST,
appKey: TingyunAPM.TINGYUN_APP_KEY,
context: context,
httpEnabled: true,
logLevel: TingyunAPM.logEnable() ? LogLevel.DEBUG : LogLevel.NONE,
// TODO: axios实例对象
// axios:axiosInstance,
network: {
enabled: true,
},
crash: {
enabled: true,
jsCrashEnabled: true,
cppCrashEnabled: true,
},
freeze: {
enabled: true
}
});
if (deviceId) {
tingyun.setUserId(deviceId)
}
tingyun.startNextSession()
}
}
\ No newline at end of file
... ...
... ... @@ -103,6 +103,7 @@ export class StartupManager {
}
private initTingyun() {
// 暂时不能用,不初始化
// Logger.debug(TAG, "App tingyunAPM 初始化")
// TingyunAPM.initApp(this.context!, DeviceUtil.clientId())
}
... ...