Browser Metrics:Data Collectors

Revision as of 00:18, 22 February 2006 by Bryner (talk | contribs) (trying to make window events be more visibly grouped)

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 data included in the profile is as follows:

  • Memory
  • OS
  • Firefox version
  • Talkback user ID
  • extensions (maybe only those from addons.mozilla.org)
  • plugins
  • screen resolution
  • default browser
  • install date
  • default search engine
  • non-default values for built-in prefs

Window Events

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

Common Window Event attributes:

window = [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.

Window Create Event

Records the creation of a new toplevel or child DOM Window.

Element name: windowcreate

Event-specific attributes:

parent = [integer window id] (optional)

The id of the parent of the newly created window, if present.

chrome = [boolean] (optional)

Whether the new window has chrome privileges. Defaults to false.

Window Open Event

Records the opening of a toplevel DOM Window.

Element name: windowopen

Event-specific attributes:

opener = [integer window id] (optional)

The id of the opener DOM window, if present.

Window Close Event

Records the closing of a toplevel DOM Window.

Element name: windowclose

Event-specific attributes: none

Window Destroy Event

Records the destruction of a toplevel or child DOM Window.

Element name: windowdestroy

Event-specific attributes: none


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.