This topic introduces the custom statistics function provided by browser monitoring of Application Real-Time Monitoring Service (ARMS).

To help you monitor and measure lightweight business interaction behavior, browser monitoring provides the following two types of custom statistics:

  • Sum statistics: counts the total number of occurrences of certain events in the business, such as the number of times that a button is clicked and the number of times that a module is loaded.

  • Average statistics: counts the average value of certain events in the business, such as the average loading time of a module.

ARMS provides the preceding two types of statistics in the following three dimensions (taking average statistics for example):

  • Statistics details

    The statistics details line chart shows the trends of Average and Sample Size of an event within a specified period of time. Assume that the time consumption data of a module is collected. In the statistics details, you can see the average time consumption data and the number of sent samples in the corresponding time interval.

  • Geographical view

    Statistics on the event in corresponding regions are collected by province or city in China or by country or region worldwide. ARMS browser monitoring provides the reported amount, average value, and unique visitor (UV) data of each region. It helps the business side quickly understand the differences between events in different regions and make decisions.

  • Terminal view

    Browsers, devices, operating systems, and resolutions affect the performance, compatibility, and display of a page. Therefore, ARMS browser monitoring provides the average values and sample sizes in these dimensions, helping the business side know the distribution of the event in different browsers, devices, operating systems, and resolutions.

Method for sum statistics

After the browser monitoring SDK is introduced on the page, use the following log reporting method in the business JavaScript (JS) file for sum statistics.

Call parameters: __bl.sum(key, value)

Call parameter description:

Parameter Type Description Required Default value
key String The name of the event. Yes None
value Number The cumulative number in each report. Default value: 1. No 1

Example:

__bl.sum('event-a');
__bl.sum('event-b', 3);
			

Method for average value statistics

After the browser monitoring SDK is introduced on the page, use the following log reporting method in the business JavaScript file for average value statistics.

Call parameter: __bl.avg(key, value)

Call parameter description:

Parameter Type Description Required Default value
key String The name of the event. Yes None
value Number The number of reported items. Default value: 0. No 0

Example:

__bl.avg('event-a', 1);
__bl.avg('event-b', 3);