Some pages use a very large number of resource files, more than can usefully be monitored. By default, the JavaScript Agent decides which resource files to monitor based on two factors:

  • How the resources are ordered (the sampling algorithm used)
  • The maximum number of resources to be evaluated 

Both of these factors can be modified.

To modify the sampling algorithm, use resTiming.sampler. Possible values are:

  • Top N: the resources that take the most time to load, up to the maximum number 
  • First N: the resources that load first, up to the maximum number
  • Relevant N: the resources that are deemed "most relevant" by an algorithm that takes into account both overall load time and when in the sequence the resource loads. So, for example, something that takes a long time to load and is early in the load sequence is "more relevant" than something that takes exactly the same time to load, but does so later in the sequence, on the assumption that the former would have more impact on the overall user experience. This is the default.

To modify the maximum number of resources to be evaluated, use resTiming.maxNum.

For example, to sample based on Top N and to set the max number at 100, you could add the following snippet to your page, before you inject the adrum.js script.

    <script type='text/javascript' charset='UTF-8'>
        (function (config) {
            config.resTiming = {
                sampler: "TopN",
                maxNum: 100
        })(window['adrum-config'] || (window['adrum-config'] = {}));
    <script src='//' type='text/javascript' charset='UTF-8'></script>