Capturing Servernames


If the web application you are monitoring has multiple frontend web servers and you would like to see performance broken down by servername then you can have the webtuna.js capture the servername by overriding the JavaScript function wt.server with your own function to get it from the application and return it to WebTuna.

The JavaScript function needs to be called wt.server and needs to be declared somewhere in the page so that it exists at the point the where the onload handler is called.

Example for PHP

This example code will capture the Servername so it can be seen by WebTuna. You may need to modify src to point to the location where you copied the webtuna.js.

//NEED SOME SERVER SIDE CODE TO GET THE SERVERNAME AND SET IT AS A JAVASCRIPT VARIABLE
<script type="text/javascript" src="https://cdn.webtuna.com/webtuna.js"></script>
 
<script type="text/javascript">
        var wt_server = '<?php echo gethostname(); ?>';
        wt.server = function ()
        {
                return wt_server;
        };
</script>

NOTE – This code must come after the line which calls webtuna.js