Labs/Test Pilot/ExperimentAPI: Difference between revisions

Jump to navigation Jump to search
Line 102: Line 102:
=== Example of declaration ===
=== Example of declaration ===


const TABS_EXPERIMENT_FILE = "testpilot_tabs_experiment_results.sqlite";
exports.dataStoreInfo = {
/* In this schema, each row represents a single UI event. */
  fileName: "testpilot_tabs_experiment_results.sqlite",
 
  tableName: "testpilot_tabs_experiment",
const TABS_TABLE_NAME = "testpilot_tabs_experiment";
  columns: [
 
    {property: "event_code", type: TYPE_INT_32, displayName: "Event",
exports.dataStoreInfo = {
      displayValue: ["", "Open", "Close", "Drag", "Drop", "Switch", "Load",
  fileName: TABS_EXPERIMENT_FILE,
                    "Startup","Shutdown", "Window Open", "Window Close"]},
  tableName: TABS_TABLE_NAME,
    {property: "tab_position", type: TYPE_INT_32, displayName: "Tab Pos."},
  columns: TABS_EXPERIMENT_COLUMNS
    {property: "tab_window", type: TYPE_INT_32, displayName: "Window ID"},
};
    {property: "ui_method", type: TYPE_INT_32, displayName: "UI Method",
  {property: "event_code", type: TYPE_INT_32, displayName: "Event",
      displayValue: ["", "Click", "Keyboard", "Menu", "Link", "URL Entry",  
  displayValue: ["", "Open", "Close", "Drag", "Drop", "Switch", "Load", "Startup",
                    "Search", "Bookmark", "History"]},
              "Shutdown", "Window Open", "Window Close"]},
    {property: "tab_site_hash", type: TYPE_INT_32, displayName: "Tab Group ID"},
  {property: "tab_position", type: TYPE_INT_32, displayName: "Tab Pos."},
    {property: "num_tabs", type: TYPE_INT_32, displayName: "Num. Tabs"},
  {property: "tab_window", type: TYPE_INT_32, displayName: "Window ID"},
    {property: "timestamp", type: TYPE_DOUBLE, displayName: "Time",
  {property: "ui_method", type: TYPE_INT_32, displayName: "UI Method",
      displayValue: function(value) {return new Date(value).toLocaleString();}}
  displayValue: ["", "Click", "Keyboard", "Menu", "Link", "URL Entry", "Search",
  ]};
              "Bookmark", "History"]},
  {property: "tab_site_hash", type: TYPE_INT_32, displayName: "Tab Group ID"},
  {property: "num_tabs", type: TYPE_INT_32, displayName: "Num. Tabs"},
  {property: "timestamp", type: TYPE_DOUBLE, displayName: "Time",
  displayValue: function(value) {return new Date(value).toLocaleString();}}];
 
 


=== Example of storing event objects ===
=== Example of storing event objects ===
1,007

edits

Navigation menu