HVEvent

An HVEvent object represents a single hit by a user on a single Web page.

Properties

  • String appName: The appName parameter from the instrumentation script that generated this event.

  • String clientIP: The IP address of the system that delivered this event to the Monitor.

  • integer downloadTime: The reported interval between initialization of the current page and final rendering (in milliseconds).

  • java.util.Date timestamp: The time when this event was received by the Monitor.

  • integer responseTime: The downloadTime+uploadTime, or downloadTime if uploadTime is out of range. This is the value used in SummaryStats calculations.

  • String title: The document title of the page that produced this event.

  • String uploadTime: The reported interval between unload of previous page and current page initialization.

  • String URL: The URL of the page that produced this event.

  • String userAgent: The userAgent value reported by the browser that sent this event.

Methods

  • String get(String fieldName): Retrieves the value of a named field.

  • String toString(): Returns a string representation of this event.

Description

An HVEvent object represents a single hit by a user on a single Web page. All properties in this object are read-only. Fields in the event have undergone any transformations implemented in the preprocessor. The get() method can be used to access any custom fields produced by xforms.

Under normal circumstances, the vast majority of events received by a monitor are discarded after processing in order to conserve system resources. However, sampling data collectors capture and report a percentage of these events as HVEvent objects. Summary reports also include a reference to a single HVEvent object, provided for reference purposes.

Example

// Calculate the median response time from sampled events
function calculateMedian(events)
{
    var median =0;
    if(events.length > 1)
    {
       var values = new Array();
       for(var i=0; i< events.length; i++)
       {
          values.push(events[i].responseTime);
       }
       values.sort(sortOrder);
       var mid = Math.floor(values.length/2);
       if((values.length % 2) == 0)
       {
         median = (values[mid-1]+values[mid])/2;
       }
       else
       {
          median = values[mid];
       }
    }
    else if(events.length == 1)
    {
       median = events[0].responseTime;
    }
    return median;
}
// ensures sorting by numeric order instead of the default alpha sort
function sortOrder(a,b)
{
   return a-b;
}