Obtaining Browser (end user) page load time data (v2)

The metric timeslice data presented on the Browser page load time chart on your application's Browser Overview page will depend on your web app's configuration. Possible components may include:

  • Network time
  • Page rendering time
  • DOM processing time
  • Web application time
  • Request queuing time

This describes how to use the New Relic REST API (v2) to obtain the data shown on the Browser page load time chart.

General API values

When making your own calculations, be aware of the following:

  • You can change the default time range (30 minutes) used in these examples.
  • For calculated values, the time range you specify must be consistent in all of the queries; otherwise the final calculations will be incorrect.
  • You must replace the ${APPID} and ${API_KEY} variables in these examples with your specific application ID and corresponding REST API key.
  • Ensure you adjust the time units returned by the API requests as needed.

Network time

The EndUser:average_network_time is the network latency, or time it takes for a request to make a round trip over the Internet. Use the following command to obtain this.

curl -X GET "https://api.newrelic.com/v2/applications/${APPID}/metrics/data.json" \
     -H "X-Api-Key:${API_KEY}" -i \
     -d 'names[]=EndUser&values[]=average_network_time' 

This time is returned in milliseconds.

Page rendering time

Page rendering time is a derived value. To calculate it, use this equation:

"Page rendering" time = EndUser:average_fe_response_time - EndUser/RB:average_dom_content_load_time

To obtain the data for this calculation, use the following commands.

  • EndUser:average_fe_response_time

    curl -X GET "https://api.newrelic.com/v2/applications/${APPID}/metrics/data.json" \
         -H "X-Api-Key:${API_KEY}" -i \
         -d 'names[]=EndUser&values[]=average_fe_response_time' 

    This time is returned in milliseconds.

  • EndUser/RB:average_dom_content_load_time

    curl -X GET "https://api.newrelic.com/v2/applications/${APPID}/metrics/data.json" \
         -H "X-Api-Key:${API_KEY}" -i \
         -d 'names[]=EndUser/RB&values[]=average_dom_content_load_time' 

    This time is returned in milliseconds.

DOM processing time

The EndUser/RB:average_dom_content_load_time is the time spent in the browser to parse and interpret the HTML. This is measured by the browser's DOM Content event.

To obtain this data, use the following command:

curl -X GET "https://api.newrelic.com/v2/applications/${APPID}/metrics/data.json" \
     -H "X-Api-Key:${API_KEY}" -i \
     -d 'names[]=EndUser/RB&values[]=average_dom_content_load_time' 

This time is returned in milliseconds.

Web application time

The Web application time is the time spent in the application code. To calculate this value, use this equation:

Web application = EndUser:total_app_time / EndUser:call_count

To obtain the data for this calculation, use the following commands.

  • EndUser:total_app_time

    curl -X GET "https://api.newrelic.com/v2/applications/${APPID}/metrics/data.json" \
         -H "X-Api-Key:${API_KEY}"  -i \
         -d 'names[]=EndUser&values[]=total_app_time' 

    This time is returned in seconds.

  • EndUser:call_count

    curl -X GET "https://api.newrelic.com/v2/applications/${APPID}/metrics/data.json" \
         -H "X-Api-Key:${API_KEY}" -i \
         -d 'names[]=EndUser&values[]=call_count' 

Request queuing time

The EndUser/RB:average_queue_time is the wait time between the web server and the application code. Large numbers indicate a busy application server.

To obtain this data, use the following command:

curl -X GET "https://api.newrelic.com/v2/applications/${APPID}/metrics/data.json" \
     -H "X-Api-Key:${API_KEY}" -i \
     -d 'names[]=EndUser/RB&values[]=average_queue_time' 

This time is returned in milliseconds.

The request queuing time is not included in the calculation of averages. New Relic includes it in this chart as a convenience.

For more help

Additional documentation resources include:

Recommendations for learning more: