Browser Metrics:Data Collectors

From MozillaWiki
Revision as of 05:18, 28 March 2006 by Darin (talk | contribs) (→‎Profile)
Jump to navigation Jump to search

Data Format

Overview

Data will be collected as a stream of events, with the exception of a user profile that is collected once every browser session. Each event type is represented by a particular XML element in the http://www.mozilla.org/metrics namespace. We will define several event types that will have predefined schemas. We will be able to throttle data collection based on the event type, so that verbose events can be turned on and off when we want. The tentative event types and associated schemas are listed below. (Note: the list is still very much in flux and will likely change.)

All event types have a time attribute, which gives a timestamp for the event, recorded as seconds since the epoch.

Profile

The profile will be collected every browser session, to pick up changes periodically. The profile element is a grouping element which contains a set of profile values.

Element <profile>
Attributes: none

The following elements are optional children of <profile>:

Element <memory>
Describes the memory configuration of the client system.
Attributes:
mb = [integer]
Gives the number of megabytes of system memory.
Element <os>
Describes the operating system the client is running.
Attributes:
name = [string]
Gives the name of the operating system, e.g. "Windows" or "MacOSX".
version = [string]
Gives the version of the operating system, e.g. "XP" or "Tiger".
Element <install>
Describes the installation of Firefox the user is running.
Attributes:
buildid = [integer]
Gives the Build ID (e.g. 20060327).
installdate = [integer]
Gives the date the build was first run on this profile (seconds since the epoch).
Element <extensions>
A container element for 1 or more extension elements.
Attributes: none
Element <extension>
Contains information about a single extension installed in the profile.
Attributes:
extensionid = [string]
Gives the extension's id.
version = [string]
Gives the extension's version number.
Element <plugins>
A container element for 1 or more plugin elements.
Attributes:
name = [string]
Gives the name of the plugin.
version = [string]
Gives the version of the plugin.
Element <display>
Describes the user's display.
Attributes:
xsize = [integer]
Gives the number of pixels horizontally on the display.
ysize = [integer]
Gives the number of pixels vertically on the display.

TBD: talkback GUID

Window Event

Window events log various actions pertaining to DOM Windows, which provide a context for load events.

Element name: window

Attributes:

action = [string]

Indicates the action that happened for this window. Possible values are:

  • create: a new toplevel or child DOM Window was created
  • open: a toplevel DOM Window was opened
  • close: a toplevel DOM Window was closed
  • destroy: a toplevel or child DOM Window was destroyed

windowid = [integer window id]

The id of the affected window. Ids are assigned starting from 0 and are never reused during that session. The window id is not unique across sessions.

parent = [integer window id] (optional)

For create events, the id of the parent of the newly created window. Toplevel windows do not have a parent, so this attribute will not be set.

chrome = [boolean] (optional)

For create events, whether the new window has chrome privileges. Defaults to false.

opener = [integer window id] (optional)

For open events, the id of the opener DOM window. Windows opened from native code may not have an opener, and this attribute will not be set.

Load Event

Load events record a document being loaded into a DOM Window.

Element name: load

Attributes: window = [integer window id]

The id of the window where the document was loaded.

origin = [string] (optional)

The action which initiated the load. Possible values include:

  • typed: The document URI was typed (or pasted) by the user.
  • link: The user followed a link to the document URI.
  • session-history: The user used back/forward navigation to load the document.
  • reload: The user used the reload button or keyboard shortcut to reload the document.
  • global-history: The user loaded the page by selecting it from their global history.
  • bookmark: The user loaded the page by selecting it from the bookmarks menu, bookmarks toolbar, or bookmarks management UI.
  • script: A script executing on a page loaded the document.
  • refresh: A meta-refresh loaded the document.
  • external: The document URI was passed in from an external application.

loadtime = [milliseconds]

The time from the initiation of the load until the document is complete (which includes all images, stylesheet, etc) in milliseconds.

bfCacheHit = [boolean] (optional)

Whether the document presentation was loaded from the session history cache. If not specified, assumed to be false.

Todo / possible todo items:

  • cache size before/after load
  • content viewer size estimate
  • cache hit
  • session history index
  • last visit date
  • tagged/bookmarked

UI Event

  • action = [click, key, drag, drop...]
  • target = [some kind of ID, possibly XUL name]

Garbage Collection

  • number/size of objects reachable
  • time spent doing garbage collection

Startup/Shutdown

  • time taken

Places UI Event

We'll have to be sure not to duplicate data here between the UI Event and the Places UI Event. This could potentially be an extension of the regular UI Event.

  • node types expanded/clicked
  • periods of time searched

Autocomplete

We may try to fit this into the schema of another event type.

  • how far down the list?
  • match but typed anyway?

Open Issues

  • We may want to consolidate some of these events into summary statistics, to compact the amount of data we are collecting. However, this may not be necessary since we will be able to throttle the data collection on a per event type.
  • To allow extensions to collect data via this system, we will need to define a generic event type or a way to extend the list of predefined events. This is TBD.
  • The event types listed above are still in flux and may be combined or removed.