Browser Metrics:Data Collection Service

From MozillaWiki
Jump to: navigation, search

Overview

The data collection service takes events, which are represented by XML elements, and puts them together into an XML document which is uploaded to the collection server.

XML Representation

The XML document that holds event data uses the namespace http://www.mozilla.org/metrics. The root element of the document is the <log> element, which has no predefined attributes.

For more information on specific event types, see Data Collector Design.

Client ID

The data collection service generates a client GUID the first time data is uploaded. The GUID is placed as an attribute into the XML file:

 <log version="2" clientid="bQYUeSd3XK8zJxRT4Y+8EA==">

Server Response

After uploading a log file, the client receives a response from the server which specifies new parameters for the collection service. This allows for the exact data collected by users to be tuned as needed. The response document takes the following format:

 <config xmlns="http://www.mozilla.org/metrics">
   <collectors>
     <collector type="ui">
     <collector type="load">
   </collectors>
   <limit events="200"/>
   <upload interval="600"/>
 </config>

More detailed descriptions of the response elements follow:

Element name: config

The root element of the configuration document. Attributes: none

Element name: collectors

A grouping element which contains 0 or more collector elements. Attributes: none

Element name: collector

Enables a specific collector on the client. Attributes: type = [collector name]

Specifies the name of the collector to enable. Valid collector types include profile, window, load, and ui. See the Data Collector Design for details on what these collectors do.

Element name: limit

Limits the amount of data collected by the client. Attributes: events = [number of events]

The client will stop collecting events once this number of events have been logged. The event count resets to 0 after a log upload.

Element name: upload

Describes how the client upload should be configured. Attributes: interval = [number of seconds]

The client should perform its next upload this many seconds from now.