SummaryDataCollector

SummaryDataCollector objects are used to analyze the HVEvent stream and periodically produce summary reports describing the content of the event stream.

Properties

  • String name: (Required) Name of the collector.

  • integer intervalDuration: (Required) Frequency with which the collector should produce reports, specified in milliseconds.

  • Function onreport: (Required) Is used to specify the event-handler to be called when the collector has reports to be processed. The expected handler signature is void yourHandlerName(SummaryReport[] reports).

  • String[] groupingFieldNames: List of HVEvent field names whose unique values will produce a discrete report.

  • FieldFilter[] inclusionFilters: List of filters that an HVEvent must match in order to be included in this collector’s reports.

  • FieldFilter[] exclusionFilters: List of filters that an HVEvent might not match if it is to be included in this collector’s reports.

  • ResponseTimeRange[] ranges: List of ranges for which a discrete set of statistics should be maintained.

  • String staleReportOption: Instruction indicating how stale reports should be handled in a distributed metrics environment.

Methods

  • String toString(): Returns a string description of the SummaryDataCollector.

  • Boolean isValid(): Returns True if all required values are populated and all populated values are valid.

Description

SummaryDataCollector objects are used to analyze the HVEvent stream and periodically produce summary reports describing the content of the event stream. These objects are generally created using one of the metrics.createSummaryCollector() methods and deployed in the implementation of an metrics.onload event-handler.

If the collector is deployed, every HVEvent that gets past the preprocessor is analyzed by it. First, the event is checked against inclusionFilters and exclusionFilters. If any inclusionFilters are defined, then an event must match at least one of them, or it is excluded. A match to an exclusionFilter also causes the event to be excluded. If an event passes the filters, the event is included in the next set of interval reports generated by this collector.

Collectors generate reports at the frequency specified by the intervalDuration property and delivered to the function specified by the onreport property. Separate reports are generated for each unique set of grouping field values and include all recorded activity for all HVEvent objects with the same set of grouping field values. After reports are delivered to the handler, the collector forgets that information, so if a given set of grouping field values has no activity in the next interval, no report is generated for it.

In a distributed HVM environment, identical collectors are deployed to all members of the HVM group. At the end of each interval, reports are collected from all HVM members and their content is consolidated into a single set of reports. For example, if a data collector specified page title as the sole grouping field and at the end of the interval HVMGroupMember1 reported the following statistics for the page called 'User Login':

and HVMGroupMember2 reported the following for the same page:

Then the report delivered to the onreport event handler can contain the following:

This consolidation of reports with the same key and interval values is automatic in a distributed HVM configuration. On occasion, a remote monitor can also deliver a report from a previous interval, because some transient condition prevented it from reporting when that interval’s data was processed (see Distributed High-Volume-Metrics Data Collection). In this situation, the stale report data (data from an earlier interval) can be rolled into the current interval’s data, reported to the event handler as a separate report for the old interval, or filtered out entirely. The value of the staleReportOptions property determines the behavior. Appropriate values are described in metrics.constants Stale Report Options.

Example

var appFilter = metrics.createFieldFilter('Banking Filter', 
          metrics.constants.FN_APPLICATION_NAME, 
          'BANKING');
var devSystemFilter = metrics.createFieldFilter('Dev System Filter',
          metrics.constants.FN_URL,
          'http://DEV.*');
          
var targetRange = metrics.createResponseTimeRange('target', 0, 1500);
var acceptRange = metrics.createResponseTimeRange('accept', 1500, 4000);
var problemRange = metrics.createResponseTimeRange('problem', 4000, 60000);
var collector = metrics.createSummaryCollector();
collector.name= 'Banking';
collector.intervalDuration=60000;
collector.onreport=processBanking;
collector.groupingFieldNames=[metrics.constants.FN_PAGE_TITLE];
collector.ranges=[targetRange,acceptRange,problemRange];
collector.inclusionFilters=[appFilter];
collector.exclusionFilters=[devSystemFilter];
collector.staleReportOption=metrics.constants.SRO_PASS;

// deploy with preprocessor and other collectors.

function processBanking(reports)
{
  // do Banking application processing
}