Search in sources :

Example 1 with IWXUserTrackAdapter

use of com.taobao.weex.adapter.IWXUserTrackAdapter in project weex-example by KalicyZhou.

the class WXBridgeManager method commitJSFrameworkAlarmMonitor.

public void commitJSFrameworkAlarmMonitor(final String type, final WXErrorCode errorCode, String errMsg) {
    final IWXUserTrackAdapter userTrackAdapter = WXSDKManager.getInstance().getIWXUserTrackAdapter();
    if (userTrackAdapter == null || TextUtils.isEmpty(type) || errorCode == null) {
        return;
    }
    WXPerformance performance = new WXPerformance();
    performance.errCode = errorCode.getErrorCode();
    if (errorCode != WXErrorCode.WX_SUCCESS) {
        performance.appendErrMsg(TextUtils.isEmpty(errMsg) ? errorCode.getErrorMsg() : errMsg);
        WXLogUtils.e("wx_monitor", performance.toString());
    }
    userTrackAdapter.commit(WXEnvironment.getApplication(), null, type, performance, null);
}
Also used : WXPerformance(com.taobao.weex.common.WXPerformance) IWXUserTrackAdapter(com.taobao.weex.adapter.IWXUserTrackAdapter)

Example 2 with IWXUserTrackAdapter

use of com.taobao.weex.adapter.IWXUserTrackAdapter in project weex-example by KalicyZhou.

the class WXBridgeManager method commitJSBridgeAlarmMonitor.

public void commitJSBridgeAlarmMonitor(String instanceId, WXErrorCode errCode, String errMsg) {
    WXSDKInstance instance = WXSDKManager.getInstance().getSDKInstance(instanceId);
    IWXUserTrackAdapter adapter = WXSDKManager.getInstance().getIWXUserTrackAdapter();
    if (instance == null || adapter == null || errCode == null) {
        return;
    }
    WXPerformance performance = new WXPerformance();
    performance.args = instance.getBundleUrl();
    performance.errCode = errCode.getErrorCode();
    if (errCode != WXErrorCode.WX_SUCCESS) {
        performance.appendErrMsg(TextUtils.isEmpty(errMsg) ? errCode.getErrorMsg() : errMsg);
        WXLogUtils.e("wx_monitor", performance.toString());
    }
    adapter.commit(WXEnvironment.getApplication(), null, IWXUserTrackAdapter.JS_BRIDGE, performance, instance.getUserTrackParams());
}
Also used : WXSDKInstance(com.taobao.weex.WXSDKInstance) WXPerformance(com.taobao.weex.common.WXPerformance) IWXUserTrackAdapter(com.taobao.weex.adapter.IWXUserTrackAdapter)

Aggregations

IWXUserTrackAdapter (com.taobao.weex.adapter.IWXUserTrackAdapter)2 WXPerformance (com.taobao.weex.common.WXPerformance)2 WXSDKInstance (com.taobao.weex.WXSDKInstance)1