对分析进行故障诊断

improve this page | report issue


概述

请查找相关信息来帮助解决在使用 MobileFirst Analytics 时可能遇到的问题。

分析控制台中没有任何数据

检查以下可能性。

  • 验证您的应用程序是否已设置为指向 MobileFirst Server,此服务器会将日志转发至 MobileFirst Analytics Server。 确保在 mfpclient.plist (iOS)、mfpclient.properties (Android) 或 config.xml (Cordova) 文件中设置了以下值。
    protocol = http or https
    host = the IP address of your MobileFirst Server
    port = the HTTP port that is set in the server.xml file for reporting analytics
    wlServerContext = by default "/mfp/"
  • 确保 MobileFirst Server 指向 MobileFirst Analytics Server。
    /analytics-service
    /analytics
  • 检查是否正在调用 send 方法。
    • iOS:
      • Objective-C:[[WLAnalytics sharedInstance] send];
      • Swift:WLAnalytics.sharedInstance().send()
      • Android:WLAnalytics.send();
      • Cordova:WL.Analytics.send();
      • Web:ibmmfpfanalytics.send();

为何在“崩溃概述”表中出现崩溃数据,但在“崩溃摘要”表中却未显示任何数据?

在应用程序恢复运行后,必须将崩溃日志发送至服务器。 验证您的应用程序在崩溃后是否发送了日志。 为安全起见,在应用程序启动时发送日志以确保报告了任何先前未发送的信息。

为何在“服务器使用情况流程”图或“网络请求”图中没有任何数据?

请将您的应用程序配置为在出现“网络”设备事件时收集分析数据。

ibmmfpfanalytics.logger.config({analyticsCapture: true});
  • 对于使用 Cordova 的跨平台应用程序,请遵循 iOS 或 Android 指南进行操作,因为本机应用程序采用相同的配置。
  • 为确保捕获 iOS 中的网络分析数据,请在应用程序委托 application:didFinishLaunchingWithOptions 方法中添加以下代码。
    Objective-C
    WLAnalytics *analytics = [WLAnalytics sharedInstance];
    [analytics addDeviceEventListener:NETWORK];
    Swift
    WLAnalytics.sharedInstance()
    WLAnalytics.sharedInstance().addDeviceEventListener(NETWORK)
  • 为确保捕获 Android 中的网络分析数据,请在应用程序子类 onCreate 方法中添加以下代码。
    Java
    WLAnalytics.init(this);
    WLAnalytics.addDeviceEventListener(DeviceEvent.NETWORK);

为何没有应用程序会话数据?

请将您的应用程序配置为使用“生命周期”设备事件侦听器来收集分析数据。

  • 对于使用 Cordova 的跨平台应用程序,请遵循 iOS 或 Android 指南进行操作,因为本机应用程序采用相同的配置。
  • 为确保捕获 iOS 中的网络分析数据,请在应用程序委托 application:didFinishLaunchingWithOptions 方法中添加以下代码。

    Objective-C
    WLAnalytics *analytics = [WLAnalytics sharedInstance];
    [analytics addDeviceEventListener:LIFECYCLE];
    Swift
    WLAnalytics.sharedInstance()
    WLAnalytics.sharedInstance().addDeviceEventListener(LIFECYCLE)
  • 为确保捕获 Android 中的网络分析数据,请在应用程序子类 onCreate 方法中添加以下代码。
    Java
    WLAnalytics.init(this);
    WLAnalytics.addDeviceEventListener(DeviceEvent.LIFECYCLE);

当有多个用户正在访问分析控制台时,此控制台无响应。


如果在低于 8.5.5.6 的 WebSphere Liberty 版本上部署了 Mobile Foundation 分析,并且有多个用户正在访问此控制台,此控制台会冻结或者停止响应任何其他用户请求。

  • 发生此情况的原因是 WebSphere Liberty 的 Executor 线程不足,以致于无法为这些请求提供服务。 这将导致死锁情况。
  • Liberty 核心线程的缺省数量等于硬件线程的数量。
  • 要解决此问题,请在 Liberty Executor 线程参数中将线程数量配置为大于缺省值的值。
    在 Liberty 的 server.xml 中添加以下配置:
    <executor name="LargeThreadPool" id="default" coreThreads="80" maxThreads="80" keepAlive="60s" stealPolicy="STRICT" rejectedWorkPolicy="CALLER_RUNS" />
  • Websphere Liberty 8.5.5.6 通常不需要这些调整设置

其他参考资料

Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.
Last modified on June 01, 2020