• About Us
  • Blog
  • Basket
  • Account
  • Sign In
  •  

User Performance Monitoring

When used with the Enterprise version of the data set the API will return information about the performance of the connection and response times via the Context. The values change for every page request and will only start to appear after the 2nd request to the web server. The following properties are available:

  • 51D_LastResponseTime (TimeSpan) – the time taken for the web page to start rendering after the user initiated the request.
  • 51D_LastCompletionTime (TimeSpan) – the time taken for the web page to complete rendering after the user initiated the request.
  • 51D_AverageResponseTime (TimeSpan) – the average time taken for the page to start rendering after the user initiated the request during the previous 5 minutes.
  • 51D_AverageCompletionTime (TimeSpan) – the average time taken for the page to complete rendering after the user initiated the request during the previous 5 minutes.
  • 51D_AverageBandwidth (Integer) – the effective average bandwidth of the connection as measured by the amount of HTML data sent and received. The value will vary from a network level inspection as it does not include the TCP or HTTP overhead. It should be used as a guide to the available effective bandwidth. The time values are of more practical use to developers.

The functionality will be available when the JavascriptBandwidth property is available for the device. The following code shows how to output the parameters:

<% if (Request.Browser["JavascriptBandwidth"] != null)
       { %>
        <div style="clear: both">
            <p>Last Response Time: <% =String.Format("{0:ss\\.fff}s", Context.Items["51D_LastResponseTime"])%></p>
            <p>Last Completion Time: <% =String.Format("{0:ss\\.fff}s", Context.Items["51D_LastCompletionTime"])%></p>
            <p>Average Response Time: <% =String.Format("{0:ss\\.fff}s", Context.Items["51D_AverageResponseTime"])%></p>
            <p>Average Completion Time: <% =String.Format("{0:ss\\.fff}s", Context.Items["51D_AverageCompletionTime"])%></p>
            <p>Average Bandwidth: <% =String.Format("{0:n0}bps", Context.Items["51D_AverageBandwidth"])%></p>
        </div>
    <% } %>

 

ASP Developers

When used with ASP the previous examples work unaltered. The necessary javascript includes are inserted automatically into the page.

MVC

The necessary javascript includes and script need to be added into the page by the developer. The following needs to be added to the header of the view:

<script src="/51Degrees.core.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
new FODBW();
//]]>
</script>

Need Help?