Browser Metrics:Data Collection Service: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(filling in some detail on metrics service)
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
= XML Representation =
= XML Representation =


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


For more information on specific event types, see [[Browser Metrics:Data Collectors | Data Collector Design]].
For more information on specific event types, see [[Browser Metrics:Data Collectors | 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:
<code>
  &lt;config xmlns="http://www.mozilla.org/metrics"&gt;
    &lt;collectors&gt;
      &lt;collector type="ui"&gt;
      &lt;collector type="load"&gt;
    &lt;/collectors&gt;
    &lt;limit events="200"/&gt;
    &lt;upload interval="600"/&gt;
  &lt;/config&gt;
</code>
More detailed descriptions of the response elements follow:
Element name: <tt>config</tt>
The root element of the configuration document.
Attributes: none
Element name: <tt>collectors</tt>
A grouping element which contains 0 or more <tt>collector</tt> elements.
Attributes: none
Element name: <tt>collector</tt>
Enables a specific collector on the client.
Attributes:
<tt>type = [collector name]</tt>
Specifies the name of the collector to enable.  Valid collector types include <tt>profile, window, load, </tt> and <tt>ui</tt>.  See the [[Browser Metrics:Data Collectors | Data Collector Design]] for details on what these collectors do.
Element name: <tt>limit</tt>
Limits the amount of data collected by the client.
Attributes:
<tt>events = [number of events]</tt>
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: <tt>upload</tt>
Describes how the client upload should be configured.
Attributes:
<tt>interval = [number of seconds]</tt>
The client should perform its next upload this many seconds from now.

Latest revision as of 17:27, 2 November 2007

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.