ANR Test

ANR stands for Application Not Responding, a dialog-based error in mobile apps that pops up when the main UI thread stays blocked for too long.

ANR errors can irredeemably ruin user experience with a mobile app. Apps that stay frozen for too long due to ANR errors rapidly lose user patronage, market standing, and ultimately, revenue! Capturing such errors as soon as they occur and locating where they have occurred - i.e., on which page/UI activity - is crucial for resolving the error in time and restoring user faith in the app's stability. This is where the ANR test helps! 

This test instantly alerts app developers / administrators to ANR errors, and also points to the page/UI activity where the error has occurred. With half the battle won, administrators can then use the detailed diagnostics reported by the test to gain additional and valuable error knowledge. Armed with this information, administrators can quickly and efficiently troubleshoot the error and avert UX disasters! 

 

Agent deploying the test : A remote agent

Outputs of the test : One set of results for every UI activity/page accessed on the monitored app on every platform it runs on

Configurable parameters for the test
Parameter Description

Test period

How often should the test be executed.

Proxy Host

If the eG agent communicates with the Mobile RUM collector via a proxy, then specify the IP address/fully-qualified host name of the proxy server here. By default, this is set to none, indicating that the eG agent does not communicate with the collector via a proxy.

Proxy Port

If the eG agent communicates with the Mobile RUM collector via a proxy, then specify the port at which the proxy server listens for requests from the eG agent. By default, this is set to none, indicating that the eG agent does not communicate with the collector via a proxy.

Proxy Username and Proxy Password

If the eG agent communicates with the Mobile RUM collector via a proxy server, and if proxy server requires authentication, then specify valid credentials for authentication against Proxy Username and Proxy Password. If no proxy server is used or if the proxy server used does not require authentication, then set the ProxyUsername and ProxyPassword to none.

Confirm Password

Confirm the Proxy Password by retyping it here.

Note:

If you Reconfigure the test later to change the values of the Proxy Username, Proxy Password, Confirm Password parameters, then such changes will be effected only if the eG remote agent monitoring the Mobile RUM component is restarted.

DD Frequency

Refers to the freqthe uency with which detailed diagnosis measures are to be generated for this test. The default is 1:1. This indicates that, by default, detailed measures will be generated every time this test runs, and also every time the test detects a problem. You can modify this frequency, if you so desire. Also, if you intend to disable the detailed diagnosis capability for this test, you can do so by specifying none against DD frequency.

Detailed Diagnosis

To make diagnosis more efficient and accurate, the eG Enterprise embeds an optional detailed diagnostic capability. With this capability, the eG agents can be configured to run detailed, more elaborate tests as and when specific problems are detected. To enable the detailed diagnosis capability of this test for a particular server, choose the On option. To disable the capability, click on the Off option.

The option to selectively enable/disable the detailed diagnosis capability will be available only if the following conditions are fulfilled:

  • The eG manager license should allow the detailed diagnosis capability
  • Both the normal and abnormal frequencies configured for the detailed diagnosis measures should not be 0.
Measurements made by the test
Measurement Description Measurement Unit Interpretation

Number of ANR's

Indicates the number of Application Not Responding errors that occurred in this UI activity/page.

Number

The value 0 is desired for this measure. A non-zero value is a cause for concern as it indicates that one/more ANR errors were captured in this activity/page. In such a situation, you can use the detailed diagnosis of this measure to know the complete details of the ANR. This will be useful for troubleshooting.

Here are some of the common triggers for ANRs:

  • Running network calls directly on the main thread.

  • Heavy database queries or file input/output (I/O).

  • Complex mathematical calculations that freeze layout rendering.

To prevent ANRs, follow the steps below:

  • Move work off the main thread using background tasks

  • Keep components light: In Anroid, ensure methods like onReceive() or service callbacks finish fast without blocking.

  • Profile regularly: Test performance and monitor thread behavior using tools like the Android Studio Profiler.

ANR's per minute

Indicates the number of ANRs that occurred every minute in this activity/page.

Number

A high valu for this measure is worrisome as it implies that ANRs are occurring frequently when a specific UI activity/page is being accessed.

The detailed diagnosis of the Number of ANR's measure displays the complete description of the ANR.

Figure 1 : The detailed diagnosis of the Number of ANR's measure