+

Search Tips   |   Advanced Search

Use raw data reports

Use the raw data reports feature to extract raw data to different databases and view it in the form of reporting tables.

Raw data reports provide you with analytics information about the applications and adapter usage, such as activity type, device information, and application version. Use the following steps to enable the raw data reports feature:

  1. Ensure that the MPF Server application server is not running.

  2. Create a separate database or a new schema for reports. This action is not mandatory but is useful because the raw data table is rapidly populated. For information about creating databases in a development environment, see Runtime database setup for development mode. For information about creating databases and schemas in a production environment, see Create the databases manually.

  3. When we work in a development environment, complete the following steps.

    1. Edit worklight.properties. Uncomment the reports.exportRawData property and set its value to true.

    2. Modify the wl.reports.db properties to contain the database settings as shown in the following example.
      #################################################
      # Raw reports #################################################
      reports.exportRawData=true
      # jndi name; empty value means Apache DBCP data source
      #wl.reports.db.jndi.name=${wl.db.jndi.name}
      # Default values for DBCP connection pool
      #wl.reports.db.initialSize=${wl.db.initialSize}
      #wl.reports.db.maxActive=${wl.db.maxActive}
      #wl.reports.db.maxIdle=${wl.db.maxIdle}
      #wl.reports.db.testOnBorrow=${wl.db.testOnBorrow}
      wl.reports.db.url=jdbc:mysql://localhost:3306/wlreport
      wl.reports.db.username=worklight
      wl.reports.db.password=worklight

    3. Ensure that the wl.reports.db.url property contains the URL of the database you are planning to use for raw data.

  4. When we work in a production environment, connect to the reports database using JNDI environment entries in addition to editing worklight.properties, as described in the previous step. See Configure a MobileFirst project in production using JNDI environment entries.

  5. Restart the application server.

    The app_activity_report table of the raw data database is populated with data as we use the applications and adapters.

    The raw data app_activity_report table contains the following information:

    Column Description
    ACTIVITY_TIMESTAMP UTC time of entry
    GADGET_NAME MobileFirst Application name
    GADGET_VERSION Application version
    ACTIVITY Activity type
    ENVIRONMENT Application environment name (Android, and so on)
    SOURCE User identifier
    ADAPTER MobileFirst adapter name
    PROC MobileFirst adapter procedure name
    USERAGENT User agent from HTTP header of client device
    SESSION_ID A unique identifier for the user's session on the server
    IP_ADDRESS IP address of the client
    DEVICE_ID A unique device ID
    DEVICE_MODEL Manufacturer model, for example Galaxy I9000
    DEVICE_OS Device operating system version
    LONGITUDE The longitude of the device. Requires that ongoing acquisition is enabled for Geo.
    LATITUDE The latitude of the device. Requires that ongoing acquisition is enabled for Geo.
    POS_USER_TIME The local time on the device when the latest position information (longitude and latitude) were updated. Requires that ongoing acquisition is enabled for Geo.
    WIFI_APS The access points visible on the device. Requires that ongoing acquisition is enabled for WiFi.
    WIFI_CONNECTED_SSID The SSID (network identification) of the connected WiFi access point. Requires that ongoing acquisition is enabled for WiFi.
    WIFI_CONNECTED_MAC The MAC address of the connected WiFi access point. Requires that ongoing acquisition is enabled for WiFi.
    WIFI_USER_TIME The local time on the device when the latest WiFi information was updated. Requires that ongoing acquisition is enabled for WiFi.
    APP_CONTEXT The application context, as set by WL.Server.setApplicationContext.

    The following activities can be included in reports:

    Activity Description
    Init Application initialization
    Login Successful authentication in using the application
    Adoption New Not supported in IBM Worklight V5.0
    Adoption Not supported in IBM Worklight V5.0
    Query Procedure call to an adapter
    Logout User logout
    Event An event handler was called

    In addition to predefined activity types, custom activities can be logged using WL.Client.logActivity("custom-string") APIs.

    When the activity is Event, the reporting information comes from the event device context instead of WL.Server.getClientDeviceContext. Also, when the activity is Event the PROC column gives the name of the event handler function that was called.

    Important: MobileFirst raw data feed can increase rapidly. The data is typically used by a BI system such as Cognos or Business Objects. It is the administrator's responsibility to purge built-in tables periodically. For example, the following commands delete Oracle database rows that are more than 30 days old from the activities_cube and app_activity_report tables. For other databases such as MySQL, modify the syntax appropriately.

    To delete rows from activities_cube that are more than 30 days old (assuming ACTIVITY_DATE is a DATE type field):

      DELETE FROM ACTIVITIES_CUBE WHERE ACTIVITY_DATE <= TRUNC(SYSDATE) - 30

    To delete rows from app_activity_report that are more than 30 days old (assuming ACTIVITY_TIMESTAMP is a TIMESTAMP type field):

      DELETE FROM APP_ACTIVITY_REPORT WHERE ACTIVITY_TIMESTAMP <= TO_TIMESTAMP(TRUNC(SYSDATE) - 30)

    Purging data by deleting rows might fail on heavily loaded systems. An alternative approach is to use database table partitions to facilitate the purging of accumulated data. See Database tuning.

    In addition to the app_activity_report table, the raw data engine also populates the notification_report table. This raw data table contains information about notifications sent from SMS event sources.


Parent topic: Reports database