Browser Metrics:Data Collectors: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
 
(12 intermediate revisions by 2 users not shown)
Line 9: Line 9:
===Profile===
===Profile===


The profile will be collected every browser session, to pick up changes periodically.  The data included in the profile is as follows:
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.


*  Memory
; Element <tt>&lt;profile&gt;</tt>
*  OS
: ''Attributes:''
*  Firefox version
:; <tt>session = [integer]</tt>
*  Talkback user ID
:: Gives the current session count, incremented everytime the browser loads
*  extensions (maybe only those from addons.mozilla.org)
:; <tt>time = [integer]</tt>
*  plugins
:: Gives the unixtime when the profile was captured
*  screen resolution
*  default browser
*  install date
*  default search engine
*  non-default values for built-in prefs


===Window Event===
The following elements are optional children of <tt>&lt;profile&gt;</tt>:


Window events log various actions pertaining to DOM Windows, which provide a context for load events.
; Element <tt>&lt;bookmarks&gt;</tt>
: A container element for 1 or more <tt>bookmarklocation</tt> elements.
: ''Attributes:'' none


Window Event Attributes:
; Element <tt>&lt;bookmarklocation&gt;</tt>
: Contains information about the location of bookmarks
: ''Attributes:''
:; <tt>foldercount = [integer]</tt>
:: Gives the number of bookmark folders
:; <tt>itemcount = [integer]</tt>
:: Gives the total number of bookmark items
:; <tt>livemarkcount = [integer]</tt>
:: Gives the total number of livemarks
:; <tt>separatorcount = [integer]</tt>
:: Gives the total number of separators
:; <tt>name = [string]</tt>
:: Gives the name of the set of bookmarks (full-tree, root, toolbar)


<tt>action = [string]</tt>
; Element <tt>&lt;cpu&gt;</tt>
: Describes the CPU of the client system.
: ''Attributes:''
:; <tt>arch = [string]</tt>
:: Gives the CPU architecture (x86, powerpc, etc).


Indicates the action that happened for this window.  Possible values are:
; Element <tt>&lt;display&gt;</tt>
<ul>
: Describes the user's display.
<li><tt>create</tt>: a new toplevel or child DOM Window was created</li>
: ''Attributes:''
<li><tt>open</tt>: a toplevel DOM Window was opened</li>
:; <tt>xsize = [integer]</tt>
<li><tt>close</tt>: a toplevel DOM Window was closed</li>
:: Gives the number of pixels horizontally on the primary screen.
<li><tt>destroy</tt>: a toplevel or child DOM Window was destroyed</li>
:; <tt>ysize = [integer]</tt>
</ul>
:: Gives the number of pixels vertically on the primary screen.
:; <tt>screens = [integer]</tt>
:: Gives the number of screens on the system.


<tt>window = [integer window id]</tt>
; Element <tt>&lt;extensions&gt;</tt>
: A container element for 1 or more <tt>extension</tt> elements.
: ''Attributes:'' none


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.
; Element <tt>&lt;extension&gt;</tt>
: Contains information about a single extension.
: ''Attributes:''
:; <tt>extensionid = [string]</tt>
:: Gives an MD5 hash of the extension's id.
:; <tt>version = [string]</tt>
:: Gives the extension's version number.


<tt>parent = [integer window id]</tt> (optional)
; Element <tt>&lt;install&gt;</tt>
: Describes the installation of Firefox the user is running.
: ''Attributes:''
:; <tt>appversion = [string]</tt>
:: Gives the current application version (e.g. 3.0b4)
:; <tt>buildid = [integer]</tt>
:: Gives the Build ID (e.g. 20060327).
:; <tt>default = [boolean]</tt>
:: Whether the browser is set as the default browser for the current user.
:; <tt>extversion = [string]</tt>
:: Gives the current spectator extension version (e.g. 2.1a9)
:; <tt>installdate = [integer]</tt>
:: Gives the date the build was first run on this profile (seconds since the epoch).
:; <tt>locale = [string]</tt>
:: Gives the locale (e.g. en-US, de, etc)


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.
; Element <tt>&lt;memory&gt;</tt>
: Describes the memory configuration of the client system.
: ''Attributes:''
:; <tt>mb = [integer]</tt>
:: Gives the number of megabytes of system memory.


<tt>chrome = [boolean]</tt> (optional)
; Element <tt>&lt;os&gt;</tt>
: Describes the operating system the client is running.
: ''Attributes:''
:; <tt>name = [string]</tt>
:: Gives the name of the operating system, e.g. "Windows" or "MacOSX".
:; <tt>version = [string]</tt>
:: Gives the version of the operating system, e.g. "XP" or "Tiger".


For create events, whether the new window has chrome privileges.  Defaults to false.
; Element <tt>&lt;plugins&gt;</tt>
: A container element for 1 or more <tt>plugin</tt> elements.
: ''Attributes:'' none


<tt>opener = [integer window id]</tt> (optional)
; Element <tt>&lt;plugin&gt;</tt>
 
: Contains information about a single plugin.
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.
:; <tt>name = [string]</tt>
:: Gives an MD5 hash of the plugin name.
:; <tt>version = [string]</tt>
:: Gives the version of the plugin.


===Load Event===
===Load Event===
Line 59: Line 111:
Load events record a document being loaded into a DOM Window.
Load events record a document being loaded into a DOM Window.


Element name: <tt>load</tt>
; Element <tt>&lt;document&gt;</tt>
: ''Attributes:''
 
:; <tt>action = [string]</tt>
:: Records if the document is being loaded or destroyed
 
:; <tt>window = [integer]</tt>
:: The id of the window where the document was loaded.


Attributes:
:; <tt>bfCacheHit = [boolean]</tt> (optional)
<tt>window = [integer window id]</tt>
:: Whether the document presentation was loaded from the session history cache.  If not specified, assumed to be false.


The id of the window where the document was loaded.
:; <tt>docid = [integer]</tt>
:: The id of the document that was loaded


<tt>origin = [string]</tt> (optional)
:; <tt>loadtime = [integer]</tt>
:: The time from the initiation of the load until the document is complete (which includes all images, stylesheet, etc) in milliseconds.


The action which initiated the load.  Possible values include:
:; <tt>memresident = [integer]</tt>
*  <tt>typed</tt>: The document URI was typed (or pasted) by the user.
:: The resident memory after the page has loaded
<tt>link</tt>: The user followed a link to the document URI.
*  <tt>session-history</tt>: The user used back/forward navigation to load the document.
*  <tt>reload</tt>: The user used the reload button or keyboard shortcut to reload the document.
*  <tt>global-history</tt>: The user loaded the page by selecting it from their global history.
*  <tt>bookmark</tt>: The user loaded the page by selecting it from the bookmarks menu, bookmarks toolbar, or bookmarks management UI.
*  <tt>script</tt>: A script executing on a page loaded the document.
*  <tt>refresh</tt>: A meta-refresh loaded the document.
*  <tt>external</tt>: The document URI was passed in from an external application.


<tt>loadtime = [milliseconds]</tt>
:; <tt>memtotal = [integer]</tt>
:: The total memory usage after the page has loaded


The time from the initiation of the load until the document is complete (which includes all images, stylesheet, etc) in milliseconds.
:; <tt>origin = [string]</tt> (optional)
:: The action which initiated the load.  Possible values include:
::* <tt>typed</tt>: The document URI was typed (or pasted) by the user.
::* <tt>link</tt>: The user followed a link to the document URI.
::* <tt>session-history</tt>: The user used back/forward navigation to load the document.
::* <tt>reload</tt>: The user used the reload button or keyboard shortcut to reload the document.
::* <tt>global-history (not implemented)</tt>: The user loaded the page by selecting it from their global history.
::* <tt>bookmark (not implemented)</tt>: The user loaded the page by selecting it from the bookmarks menu, bookmarks toolbar, or bookmarks management UI.
::* <tt>script (not implemented)</tt>: A script executing on a page loaded the document.
::* <tt>refresh</tt>: A meta-refresh loaded the document.
::* <tt>external (not implemented)</tt>: The document URI was passed in from an external application.


<tt>bfCacheHit = [boolean]</tt> (optional)
:; <tt>session = [integer]</tt>
:: Gives the current session count, incremented everytime the browser loads


Whether the document presentation was loaded from the session history cache.  If not specified, assumed to be false.
:; <tt>subframe = [integer]</tt>
:: Whether the document was loaded from a subframe.  If not specified, assumed to be false.


Todo / possible todo items:
:; <tt>time = [integer]</tt>
*  cache size before/after load
:: Gives the unixtime when the document load was captured
*  content viewer size estimate
 
*  cache hit
:; <tt>urlhash = [string]</tt>
*  session history index
:: Gives the md5 hash of chrome document load URLs
*  last visit date
*  tagged/bookmarked


===UI Event===
===UI Event===


action = [click, key, drag, drop...]
Records UI events
target = [some kind of ID, possibly XUL name]
 
; Element <tt>&lt;uielement&gt;</tt>
: ''Attributes:''
:; <tt>action = [string]</tt>
:: Records what caused the event (command, popupshowing)
 
:; <tt>keyidhash = [string]</tt>
:: Records the md5 hash of the key combo that caused the event (goBackKb, etc)
 
:; <tt>session = [integer]</tt>
:: Gives the current session count, incremented everytime the browser loads
 
:; <tt>targetanonidhash = [string]</tt>
:: Gives the md5 hash of the anonymous target id that caused the event
 
:; <tt>targetidhash = [string]</tt>
:: Gives the md5 hash of the target id that caused the event
 
:; <tt>time = [integer]</tt>
:: Gives the unixtime when the event was captured
 
:; <tt>window = [integer]</tt>
:: The id of the window where the document was loaded.
 
== Other Ideas ==


===Garbage Collection===
===Garbage Collection===
Line 126: Line 214:


*  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.
*  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.
*  The event types listed above are still in flux and may be combined or removed.

Latest revision as of 18:29, 27 February 2008

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:
session = [integer]
Gives the current session count, incremented everytime the browser loads
time = [integer]
Gives the unixtime when the profile was captured

The following elements are optional children of <profile>:

Element <bookmarks>
A container element for 1 or more bookmarklocation elements.
Attributes: none
Element <bookmarklocation>
Contains information about the location of bookmarks
Attributes:
foldercount = [integer]
Gives the number of bookmark folders
itemcount = [integer]
Gives the total number of bookmark items
livemarkcount = [integer]
Gives the total number of livemarks
separatorcount = [integer]
Gives the total number of separators
name = [string]
Gives the name of the set of bookmarks (full-tree, root, toolbar)
Element <cpu>
Describes the CPU of the client system.
Attributes:
arch = [string]
Gives the CPU architecture (x86, powerpc, etc).
Element <display>
Describes the user's display.
Attributes:
xsize = [integer]
Gives the number of pixels horizontally on the primary screen.
ysize = [integer]
Gives the number of pixels vertically on the primary screen.
screens = [integer]
Gives the number of screens on the system.
Element <extensions>
A container element for 1 or more extension elements.
Attributes: none
Element <extension>
Contains information about a single extension.
Attributes:
extensionid = [string]
Gives an MD5 hash of the extension's id.
version = [string]
Gives the extension's version number.
Element <install>
Describes the installation of Firefox the user is running.
Attributes:
appversion = [string]
Gives the current application version (e.g. 3.0b4)
buildid = [integer]
Gives the Build ID (e.g. 20060327).
default = [boolean]
Whether the browser is set as the default browser for the current user.
extversion = [string]
Gives the current spectator extension version (e.g. 2.1a9)
installdate = [integer]
Gives the date the build was first run on this profile (seconds since the epoch).
locale = [string]
Gives the locale (e.g. en-US, de, etc)
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 <plugins>
A container element for 1 or more plugin elements.
Attributes: none
Element <plugin>
Contains information about a single plugin.
name = [string]
Gives an MD5 hash of the plugin name.
version = [string]
Gives the version of the plugin.

Load Event

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

Element <document>
Attributes:
action = [string]
Records if the document is being loaded or destroyed
window = [integer]
The id of the window where the document was loaded.
bfCacheHit = [boolean] (optional)
Whether the document presentation was loaded from the session history cache. If not specified, assumed to be false.
docid = [integer]
The id of the document that was loaded
loadtime = [integer]
The time from the initiation of the load until the document is complete (which includes all images, stylesheet, etc) in milliseconds.
memresident = [integer]
The resident memory after the page has loaded
memtotal = [integer]
The total memory usage after the page has 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 (not implemented): The user loaded the page by selecting it from their global history.
  • bookmark (not implemented): The user loaded the page by selecting it from the bookmarks menu, bookmarks toolbar, or bookmarks management UI.
  • script (not implemented): A script executing on a page loaded the document.
  • refresh: A meta-refresh loaded the document.
  • external (not implemented): The document URI was passed in from an external application.
session = [integer]
Gives the current session count, incremented everytime the browser loads
subframe = [integer]
Whether the document was loaded from a subframe. If not specified, assumed to be false.
time = [integer]
Gives the unixtime when the document load was captured
urlhash = [string]
Gives the md5 hash of chrome document load URLs

UI Event

Records UI events

Element <uielement>
Attributes:
action = [string]
Records what caused the event (command, popupshowing)
keyidhash = [string]
Records the md5 hash of the key combo that caused the event (goBackKb, etc)
session = [integer]
Gives the current session count, incremented everytime the browser loads
targetanonidhash = [string]
Gives the md5 hash of the anonymous target id that caused the event
targetidhash = [string]
Gives the md5 hash of the target id that caused the event
time = [integer]
Gives the unixtime when the event was captured
window = [integer]
The id of the window where the document was loaded.

Other Ideas

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.
  • The event types listed above are still in flux and may be combined or removed.