Table of contents
Last update: 11/9/2018
Definition
In some cases, the need is not to measure the full page load as per default RUM script behaviour, but only a partial load within the application:
- Popup/Popin
- Specific HTML field refresh
- etc.
This means the RUM BI javascript need to be customised for either:
- for stoping the timing, when the start is still a mouse click
- for both start & stop actions, when the mouse click is not accurate as a start time
There are also 2 cases of Ajax to be identified by analyzing the HTTP trafic and HTML/Javascript code :
- AJAX with HTML return: here we assume that the click action is still the starting point. After that, use clobs.ax(page name) in the returned HTML <script> block to stop the measurement. More details are given here: http://sf1.col.ip-label.net:8000/f/0140890f60/. For reporting, the 'page name' string can be used to defined Universe within a regular expression rule.
- Ajax with callback : When doing ajax calls with JSON for example, there is no HTML code where the script can be embedded, use the start/stop timer from the right location within the web application. For reporting, the timer name can be used to defined Universe within a regular expression rule. clobs.startTimer('timerName');
and clobs.stopTimer('timerName');
clobs.abortTimer('timerName');
Mode details can be found under this link: http://sf1.col.ip-label.net:8000/f/d90b0eeded/
Example for HTML return
Ajax start:
<script type="text/javascript">var iplajax=1;var iplobserverstart=new Date();</script>
Ajax stop in HTML code:
<script type="text/javascript">clobs.ax(document.URL+".popin");</script>
Example for Ajax callback usage
Ajax start:
clobs.startTimer('ajax_post');
The Ajax timer stop is triggered in the method callback definition :
$.ajax({
url : "AJAX_POST_URL",
type: "POST",
data : formData,
success: function(data, textStatus, jqXHR)
{
//data - response from server
//The server answered: stop the RUM timer
clobs.stopTimer('ajax_post');
},
error: function (jqXHR, textStatus, errorThrown) {
clobs.abortTimer('ajax_post');
}
});
For debug from the browser making the test, please see the PDF documentation that explains how to verify the collector call and how to decode the tag with http://gx.ip-label.net/rumbi/decode.php (add ?extra for mor details).
A demo page can be found here: http://rumbi-testpage.dev.ip-label.io/
Measurements
If required, the "development mode" can be activated when working with Ajax so that no onload or Navigation timing records will be generated.
var ipldevmod = 1;
add also rumbiConf.ajax = 1
for a start on click events(definition of listeners).
Reporting & Universe creation
For each timer, a specific universe should be created with the timer name (as for iplparcours).
Comments