Browser Metrics:Data Collectors: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 31: Line 31:


Indicates the action that happened for this window.  Possible values are:
Indicates the action that happened for this window.  Possible values are:
 
<ul>
<li><tt>create</tt>: a new toplevel or child DOM Window was created</li>
<li><tt>create</tt>: a new toplevel or child DOM Window was created</li>
<li><tt>open</tt>: a toplevel DOM Window was opened</li>
<li><tt>open</tt>: a toplevel DOM Window was opened</li>
<li><tt>close</tt>: a toplevel DOM Window was closed</li>
<li><tt>close</tt>: a toplevel DOM Window was closed</li>
<li><tt>destroy</tt>: a toplevel or child DOM Window was destroyed</li>
<li><tt>destroy</tt>: a toplevel or child DOM Window was destroyed</li>
 
</ul>


<tt>window = [integer window id]</tt>
<tt>window = [integer window id]</tt>

Revision as of 02:42, 3 March 2006

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 Event

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

Window Event 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

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.

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.