You are on page 1of 26

Lab: Analytics

Using IBM MobileFirst Operational


Analytics
Lab Exercise

Table of Contents
1.1 Operational Analytics Overview ....................................................................................................................... 3
1.1.1 Goals and Features of MobileFirst Operational Analytics ......................................................................... 3
1.1.2 Operational Analytics ..................................................................................................................................................... 3
1.1.3 Analytics Console ............................................................................................................................................................... 4
1.1.4 Events that are automatically logged ..................................................................................................................... 5
1.1.5 WL.Analytics.log client-side API ............................................................................................................................... 5
1.2 Analytics Console Walkthrough ........................................................................................................................ 6
1.2.1 Starting the Analytics Server ...................................................................................................................................... 6
1.2.2 Dashboard Page .................................................................................................................................................................. 6
1.2.3 Devices Page ...................................................................................................................................................................... 12
1.2.4 Network Page .................................................................................................................................................................... 17
1.2.5 Servers Page ...................................................................................................................................................................... 18
1.2.6 Security Page ..................................................................................................................................................................... 21
1.2.7 Search .................................................................................................................................................................................... 23
1.2.8 Administration ................................................................................................................................................................. 25
1.3 Summary ................................................................................................................................................................ 26

Contents

Page 2

IBM Software

Using MobileFirst Operational Analytics


In this lab, you will explore the capabilities of MobileFirst Platform Foundations operational analytics. The operational
analytics features provided by the IBM MobileFirst Platform Foundation allow MobileFirst you to view app activity, the
performance of adapters connecting the app to other systems, client log and crash reports, and server logs in a scalable
analytics platform. Captured analytics data can be viewed in a set of provided reports and graphs or searched and filtered
across apps, services, devices, and other sources to collect data about usage and to detect and diagnose problems.
In this lab you will review the different views in the Analytics console. For this Lab the operational analytics run on the
MobileFirst Development Server in your Studio development environment. In a real production environment the analytics
component should run on the MobileFirst Server in order to capture all the mobile application-server interactions.
You should review the first section carefully to get a good understanding of the MobileFirst operational analytics model.

1.1

Operational Analytics Overview

1.1.1

Goals and Features of MobileFirst Operational Analytics

IBM MobileFirst includes a scalable operational analytics feature that is accessible in the IBM MobileFirst Console. The
analytics feature enables enterprises to search across logs and events that are collected from devices, apps, and servers for
patterns, problems, and platform usage statistics.
Data is aggregated into a central place with pre-made analytics charts and visualizations. There is zero required effort to
instrument source code or to understand the structural format of the data. You do not need to write or purchase additional
analytics aggregation tools; just use the pre-made analytics platform we provide as a WAR file installable on any application
server
The analytics platform can be clustered for redundancy, performance, and distribution of data.
The setup is simple. Data will be automatically sent to the analytics component when an analytics URL is configured on the
Worklight Server. This can be configured via a JNDI property.

1.1.2

Operational Analytics

The operational analytics platform collects data about applications, adapters, devices, and logs to give a high-level view of the
client interaction with the MobileFirst Server and to enable problem detection.
The data for operational analytics includes the following sources:

Interactions of any application-to-server activity (anything that is supported by the MobileFirst client/server protocol,
including push notification).

Server-side logs that are captured in traditional MobileFirst log files.

Crash events of an application on iOS and Android devices, including for native code and JavaScript errors.

Page 3

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

The operational analytics feature (when configured) is accessible from the MobileFirst Console and includes the following
capabilities:

Near real-time analytics for client activity with the MobileFirst Server.

Analytics for adapter hits.

Network latency analytics.

Authentication Failure analytics

Custom chart creation

Client logs search and download.

Server load analytics

Server log search and download.

Crash and stack trace search.

In addition to an at-a-glance view of your mobile and web application analytics, the analytics feature includes the capability to
perform a raw search against server and client logs, captured client crash data, and any extra data you explicitly provide
through client and server API function calls that feed into the IBM MobileFirst Analytics Platform.
When an instrumented client application submits log events to the server each one is treated as a JSON document. The data in
the document is indexed so that it can be searched by keywords in the document and presented in a canonical form that shows
the app name, version, some device data, location (if enabled), timestamp, adapter (if present in the document) and other data.

1.1.3

Analytics Console

The Analytics Console provides a number of Operational Analytics views, giving an additional layer of visibility into the
operational characteristics of the server, the applications running on it and the community of users. This information includes
charts, server and client log messages, and device usage breakdowns and trends over the last 30, 60 and 90 days.

Page 4

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

1.1.4

Events that are automatically logged

By default the MobileFirst Server will automatically log server events such as authentication failures, server log messages,
application logins, adapter invocations, and push notifications. If the client application is enabled to do so it will also
automatically route application crash details through MobileFirst Server and into the analytics platform.

1.1.5

WL.Analytics.log client-side API

The client-logging feature enables developers to create logs to help debug problems and capture errors. A separate analytics
API exists for creating logs that are not meant for problem detection and capture:
WL.Analytics.log( object, message );
For example:
WL.Analytics.log( { Coupon: add } , User saved a coupon on the device );
Logs that are created by the client-side logger are only captured based on the logging level that is set, which allows you to tune
how much data you collect. For example, DEBUG logs are not captured when the logging level is set the FATAL. However,
logs that are produced by this analytics API are always captured, despite the current logging level.
With this capability, developers can instrument their MobileFirst applications with meaningful log messages that are
automatically routed from the mobile device through the MobileFirst infrastructure and into the Analytics platform. This can
provide exceptional visibility into the operations of individual sessions of the apps running on remote mobile devices, without
needing cables, debuggers or even to know beforehand who, when or where the app is being used.
Note that the API naming prefix of WL has been preserved to ensure app compatibility between the MobileFirst V 7.0 server
and apps created for earlier versions of the platform when it was known as Worklight.

Page 5

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

1.2

Analytics Console Walkthrough

In this section youll walk through the different pages of the MobileFirst Platform Foundation Analytics Console using the
server on your lab machine. This document includes annotated screen shots of each page to guide you. The data you see on
your lab machine will probably differ from these screen shots. Youre encouraged to look around the Analytics console on
your lab machine as you read this to see what you uncover.

1.2.1

Starting the Analytics Server

If using the corresponding VMware image, you will need to start the Analytics server and open the Console. The server is preconfigured on the VM in a web application server. Start it by opening the MobileFirst Platform folder on the desktop and
hitting the Start Analytics Server.bat icon:

This should start the web application server for the analytics component and inform you of its success.

1.2.2

Dashboard Page

The Dashboard page provides an overview of whats happened that includes information about both users running apps on their
devices and users accessing mobile web apps thru a browser.
The Analytics Dashboard is viewed with a web browser. If using the supplied VMware image, the Dashboard URL will likely
be:
http://localhost:9082/analytics/console/
Please ask your lab instructor if this URL does not bring up the dashboard.
One the left the filters allow you to select a time period, a specific app, and a specific app version. Youll see filters on most of
the Analytics Console pages, but they wont be shown in most of the screen shots in order to make the pictures of the graphs in
this document larger and more readable.
The Dashboard page includes four tabs, Overview, Adapters, Push Notifications, and Custom Charts.
The counts across the top of the Overview tab show user sessions with a total, and separate counts for device and web sessions.

Page 6

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

The Sessions bar chart shows session count across the selected time period. Hover your cursor over a bar to see the breakdown
by session type. Hover help is provided for many other charts in the Console as well so look for that as you go.
The App Usage pie chart shows the session counts broken out by app. The Environment usage pie shows sessions broken out
by OS environment. The Adapter Call pie shows a count of adapter calls broken out by adapter. Adapters are used to connect
apps to external data systems, either your internal systems, your partners systems, or public systems and services. This gives
you a high level view of the volume and distribution of app calls to those systems and services.

Page 7

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

Scrolling down the page, the New Devices bar chart shows how many new devices have installed the app in the selected time
period.

Usage Note: This page allows you to easily track volume of activity and distribution across apps, Device OSes, and adapter
calls connecting to systems of record. This also allows you to track how app usage, device environments, and adapter usage
are changing over time to identify trends, and to use the filters isolate problem areas.
The Adapters tab breaks down the count of calls from apps to the adapters across time in the bar chart. Adapters are used to
connect apps to external data systems, either your internal systems, your partners systems, or public systems and services.
Use the filters to change the time period and select specific adapters. The Calls Per app pie chart shows calls broken out by
app. The Procedure Calls pie breaks down the adapter calls by the procedures exposed by each adapter, which map to names
of the JavaScript functions executed by the adapter. The Calls Per Server pie breaks calls down by which MobileFirst Platform
Foundation server serviced the adapter call. In the example below youre looking at the calls over the last 24 hours to the
Security Adapter, which executes user login and logout functions.

Page 8

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

The Push Notifications tab breaks down the count of notifications to the apps from the various device OS push notification
services across time in the bar chart.
Use the filters to change the time period and select specific apps. The Notifications by Mediator pie chart shows them broken
out by notification service. In the example below youre looking at the notifications over the last 24 hours to the
InsuranceReport app, with about 50% come from Googles GCM and 50% coming from Microsofts MPNS. Custom Charts
The Custom Charts tab allows you to create your own charts on your Dashboard.
Lets create a couple of security related custom charts showing how you can extend your dashboard. From here click on New
Chart.

On the Chart Definition sub-tab, make the following entries, and then click on Filters.

On the Filters tab make these entries, and then click Add Filter.

Page 9

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

Create a second filter on device OS version. Your result should look like the screen shot below. Then go to the Chart
Properties sub-tab.

Add a Threshold Line. Your results should look like this. Click Save New Chart.

MobileFirst entities such as applications or adapters are protected from unauthorized access by security tests that contain one or
more authentication realms. An authentication realm defines the process to be used to authenticate users. Lets create a Flow
Chart that shows which realms are experiencing the most iOS V7.0 authentication failures. Repeat what you did above,
selecting a Flow Chart chart type, and configure it as shown below.

Page 10

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

Add filters if you want to restrict which authorization failures are included.

Your results should look something like this, although your data may vary.

Note that custom charts can provide app and enterprise specific reports when based on Custom Activities. In addition to the
standard events captured by MobileFirst Analytics you can also create your own customized events, called Custom Activities,
which can be used with charts. Custom Activities are usually used for the collection of business relevant information such as
how often users exercise a specific app function. They can include any app function of business data required. For example, if
you want to track how often a button labeled Calculate Total is pushed you can do this with a single line of code added to the
button like the following example.
function buttonA(){
var event = {buttonPress: 'CalcTotal'};
WL.Analytics.log(event, 'Custom event for CalcTotal button press');
}
Read more about Custom Analytics at
http://www01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.monitor.doc/monitor/c_op_analytics_customanalytic
s.html

Page 11

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

1.2.3

Devices Page

The Devices page contains 3 tabs.


The Device Overview tab narrows the focus a bit by excluding mobile web sessions and only tracking activity for apps on
devices. The filters on the left can be used to alter the time scale and drill down into the data. This tab shows Devices active,
Sessions, and Adapter Calls across the top.

Lower on the page we see the session count and pie charts reflecting device environment (OS), model, and OS version. Some
pic charts will contain a slice labeled Other that lumps together the less common values to simplify the chart. Where you see
this, clicking on the Other slice in the pie will drill down. Reload the page to restore the original view.

Page 12

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

The JSONStore tab shown below tracks the performance of the use of the MobileFirst Platform Foundation JSONStore feature
to securely store encrypted data on devices. JSONStore provides the capability to encrypt and store data on devices in JSON
format. Think of it roughly as a database manager for JSON files.
In this screen shot were looking at the performance of PictureGallery app and drilled down to a particular collection called
animals. Collections are a JSONStore concept roughly equivalent to a database, a grouping of related JSON files.
Usage Note: Different collections might have very different average files sizes, patterns of access, etc. The capability here
allows you to identify problems that might be caused by specific apps or even specific JSONStore collections due to response
times or file size.

Page 13

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

Scrolling down we see the average response time for the operations against the animals collection.

Usage Note: You can also look at JSONStore performance for a collection across all applications to see, for example, how
PictureGallerys JSON performance compares to other apps that might also use the same animals collection.
The Device Search tab shown below lets you search for view information about specific devices. You can start from a list of
all devices and filter that by device OS, device Model, and OS version, or you can search by device ID.

Once you select the device youre looking for you this tab displays information about the devices usage of resources. And, you
can download and view logs from the device, assuming the user has opted in to allow MobileFirst to collect device logs.
Its easy to do, but you have to have the users permission.

Page 14

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

The usage flow diagram shows which apps have been used, indicated by the center bars on the chart, have connected to which
MobileFirst servers, indicated by the bars on the right. This shows you which apps are being used and how load distribution is
spreading the load for that user. In this example the PictureGallery app has only connected to one of three servers, the one is
the Austin data center, which could indicate a problem if you expect even load balancing across servers.

Further down you see more details about that device such as sessions over time, as well as app, adapter, and server usage.

Page 15

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

Usage Note: This shows that this device has been run the PictureGallery app infrequently, only 20% of the total sessions. And
across all apps the devices has been serviced 30% of the time by the Austin server. Putting this together its possible that this
user has simply not run the PictureGallery app frequently enough for her load pattern to include all 3 servers. The next step
would be to look at other devices running the PictureGallery app to see if they are connecting to Austin, and going to the
Servers page to see if Houston is over or under utilized.
The net here is that this page allows you to drill down into detail about the usage and app and OS configuration of specific
devices to help your team understand how your app is being used and to prioritize where improvements can be made.
Downloading the devices logs will open the logs in a text editor.

These log entries are assembled by the MobileFirst Platform Foundation server from the information provided in javautil
logging calls made by the app and metadata collected by the server. Theyre JSON formatted for export to other tools that read
JSON.

Page 16

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

1.2.4

Network Page

The Network Summary tab displays the data on the round trip response times for client requests to the MobileFirst Platform
Foundation server, and volume of data downloaded per request. The filters allow you to drill down into the behavior of
specific apps or app versions, and specific environments. For example, if someone reports a performance problem with an app
you can start here to look for the problem.
On this next screen shot were looking at the average performance of version 1.0.5 of the InsuranceReport app, over the last 7
days, on iPhone4 devices. We see a recent spike in average backend response time in the time series chart. This is the time it
takes your backend systems to respond to a request from the MobileFirst server. This is only one part of the total response time
experienced by the user.

Blow this the Network Requests bar chart allows you to examine that total user response time. This chart shows averages for
two data points for each backend service. The bar itself reflects total user response time, from the device back to the device,
and the number to the right of the bar shows the backend response time. A long bar, like the top one, with a small number
indicates that user response is being slowed by something other than the backend response.

Page 17

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

Clicking on the arrow beside the service URL expands that entry and shows you the backend and total response times, and the
size of the data payloads. As might be expected, the slow total response time here seems likely to be a result of sending large
data packets back to the device. This suggests the developers should focus, for the next version, on reducing the amount of
data returned to the device by this service, which would reduce response time and data plan usage. If the size of the data cant
be reduces, we should at least look at ensuring the download is async to avoid making the app UI feel slow.

Usage Note: This information allows you to trouble shoot and target specific areas of app performance for improvement.
Using the filters on this tab lets you look at the performance of the app as a whole, and then drill down to compare performance
across different OS platforms for example, where you might find a significant performance difference between the Android and
iOS versions of the app, or that the newest version of the iOS app, which the user reporting the problem is running, is
underperforming compared to a prior version.

1.2.5

Servers Page

The Servers page shows data on how your MobileFirst Platform Foundation servers are being used. The Server hits bar chart
counts user sessions and adapter calls across the time filter selected.

The Server Usage Flow below shows you how much traffic is being directed to each server. In this example there are 3 servers
that seem to be load balanced such that each carries the same load.

Page 18

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

Adapter hits shows the distribution of load by adapter.

Weekly Log Severity shows log events mined from the server logs broken out by logging level. The Server Logs table shows a
table view of log events with the ability to download and view logger messages extracted from the server logs.

Page 19

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

These log entries are assembled by the MobileFirst Platform Foundation server from the information provided in javautil
logging calls made by the app and metadata collected by the server. Theyre JSON formatted for export to other tools that read
JSON.

Usage Note: This page allows you to track load distribution across servers, graphically view the distribution of different types
of log events over time, and drill down into the server logs as desired. This app perspective provides the business function
perspective that is missing from general purpose, hardware oriented server monitoring tools. Combining the MobileFirst
Platform Foundation Analytics information with the hardware-oriented server monitoring gives you the complete view and
allows you to correlate business function with hardware load and performance.

Page 20

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

1.2.6

Security Page

The Security page has three tabs that display information about failed authentications to help you identify a number of different
types of problems including both security threats and system performance problems. The three tabs allow you to break this
information down by app, by security realm, or by resources. Realms are security tests that must be passed before an app can
access a protected resource. Protected resources are things like adapters.

Clicking on realm with a high failure rate drills down into the reasons for the failures.

Usage Note: This page provides powerful capability to monitor both security threats and the performance of your security
infrastructure. Potential use cases for authentication analytics include the following.

Page 21

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

Network issues
If an application gets popular, more people are trying to access a protected resource (such as their account information). Using
the Security tab of the Operational Analytics console, you notice a high failure rate on one of the realms. That realm is part of
the security test used to allow users to log in and view their account information. The most common error under Authenticator
Failures is an internal server error. One reason for this error is that the backend infrastructure (the number of servers) needs
improvement to meet the increase in demand.
Security threats
You notice that there is a high failure rate on one of the protected resources (such as account information). Looking at the
Authenticator Failures, you notice the most common error is invalid credentials. That error gets returned when the client
supplies an invalid user name or password. This might mean a hacker is attempting to access a protected resource by trying
different credentials within short time intervals. Based on this information, you conclude that you should not allow users to try
different credentials indefinitely. With the data provided by the analytics console, you decide to let users attempt 5 wrong
credentials before asking users to wait a specific amount of time before allowing them to try again. The goal is to limit the
effectiveness of a brute force attack.
Application usability issues
In addition to using their user name and password to access the application and view their account balances, users also need to
supply their bank's pin number to transfer money between accounts. You notice a high failure rate in the realm that asks for the
pin number. Looking at the Authenticator Failures, you notice the most common error is client interaction required. This means
the server is expecting credentials (the pin number) but is not receiving them. This can be caused by a high percentage of users
inability to understand the user interface. The users are not noticing that they need to send their pin number. Based on these
findings, the page should be redesigned to solve that issue.
Development defects
You are viewing security information from the last 24 hours and notice the failure rate for one of the realms is 100%, meaning
that it always fails. This might result from a recent change introducing a regression that broke one of the realms. Another
possibility, based on the realms provided by the platform, is that wl_directUpdateRealm is failing. This happens because
of an issue with direct update. A third possibility is evident when an entry with [Unknown Realm] is displayed in the list of
realms. This happens when there is a failure before one of the realms is reached. Having this information is especially useful
when running an application in production.

Page 22

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

1.2.7

Search

The Log Search page has separate tabs for search client and server logs.
On the Client Logs tab you can search for logs based on a combination of keywords (such as device ID or type), App name,
device type, log level, and Package. Packages, which youll see in the listings below, are arbitrary developer defined strings,
like tags, following the usual logger concepts.

These logs capture the debug log output that developers build into the app as they are sent by the app back to the server. Once
youve found a log you want to look at click it to see more information.

Page 23

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

Click Download all logs for this device to open the actual logs in a text editor.
* Note: The log sample data used in setting our training lab machines is test data that was generated by a test harness that
randomly mixes and matches sets of seed data. We use this for load testing and to populate sample data for demonstrations. In
As a result, some of the log entries you see in this lab may not make sense. For example, you might see an android log with
an Apple Objective-C stack trace. In product the logs are real logs from real devices.
Server log search works in a similar manner, allowing you to find, drill into, and download time ranged server logs.

Usage Note: The log search capability allows you to both drill into issues raised with specific devices and servers but also to
prospect for the information that will help you ward off problems and improve the users experience.

Page 24

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

1.2.8

Administration

The Export Data tab of the Administration page allows you to export the raw analytics data in JSON, CSV and XML format
for use in other analytics tools.

Note the inclusion of Custom Activities in the list above. Custom activities are analytics log events defined by the app
developer, usually for the collection of business relevant information such as how often users exercise a specific app function.
For example, if you want to track how often a button labeled Calculate Total is pushed you can do this with a single line of
code added to the button like the following example.
function buttonA(){
var event = {buttonPress: 'CalcTotal'};
WL.Analytics.log(event, 'Custom event for CalcTotal button press');
}

Page 25

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

IBM Software

1.3

Summary

Congratulations! You have completed the Analytics Lab. This has been a walk through of the MobileFirst Platform Foundation
Operational Analytics Console. Youve seen how easy it is to track and analyze the behavior of you client side apps and
devices as well as your server side adapters and MFP servers. App integration into the Analytics is automatic, with the ability
to also add custom logging information. This kind of visibility makes the difference between proactively knowing how your
apps are performing and waiting to react to what your users to tell you or post in reviews. Analytics data is easily integrated
with other tools and repositories.

The analytics repository exposes a REST-based interface

Organizations search for and export information in JSON format

Collected data can be loaded into enterprise reporting systems such as Cognos

Thank you!

Page 26

MobileFirst Platform 7.0 Proof of Technology Analytics Lab

You might also like