Browser - Collecting metrics of page load time

Hello, I am looking for the best pratice to measure Browser page load time for RUM. However, I am not sure what should be the correct fucntion to use and capture the values “average” or “percentile”. Please if possible explain the concept?

My intention is to capture these values and compare or identify where is the bottle neck (Network,Webapp,DOM,Rendering).

Just sharing the query I am using:

  1. SELECT average(firstPaint), average(firstContentfulPaint), average(duration) as ‘Avg Page Load time’ FROM PageView SINCE 1 hours ago

  2. SELECT percentile(firstPaint), percentile(firstContentfulPaint), percentile(duration) as ‘Avg Page Load time’ FROM PageView SINCE 1 hour ago

  3. SELECT average(networkDuration) as ‘Network’, average(webAppDuration) as ‘Web application’, average(domProcessingDuration) as ‘DOM’, average(pageRenderingDuration) as ‘Rendering’, average(duration) as ‘Duration’ FROM PageView SINCE 1 hour ago TIMESERIES AUTO

Hi @Renato.Malvino,

There’s no one single way to approach this - it’s really going to depend on the questions you’re trying to answer with your measurement.

We have some great documentation on the various NRQL aggregator functions available. I’ll also quote the specific definitions for both percentile and average here:

average(attribute)

Use the average( ) function to return an average value for an attribute across some facet. If no facet is provided, it will average all values for that attribute in the specified time range. If the attribute is not numeric, it will return a value of zero.

It takes a single argument. Arguments after the first will be ignored, with no error reported. If the attribute is not numeric, it will return a value of zero.

percentile(attribute [, percentile [, ...]])

Use the percentile( ) function to return an attribute’s approximate value at a given percentile. It requires an attribute and can take any number of arguments representing percentile points. The percentile() function enables percentiles to displays with up to three digits after the decimal point, providing greater precision. Percentile thresholds may be specified as decimal values, but be aware that for most data sets percentiles closer than 0.1 from each other will not be resolved.

The three examples you listed simply show different aspects of your page load timing, and they may all be useful to you in different ways. (However, I advised adjusting the label used on your second query since as 'Avg Page Load Time' is incorrect. Using a PERCENTILE function without a specified value will default to the 95th percentile.)

I also encourage you to check out our user-generated NRQL library, where other customers have shared examples of queries and dashboards that they use often and have found helpful. You can find that here: Useful Insights NRQL queries library

2 Likes

thank you for your support