Bug 1251052 - Add a new experiment for tuning the displayport size. r=felipe
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 26 Feb 2016 14:50:01 -0500
changeset 81 844bf183109a234e4cc11d1eec88eca3c5ea3421
parent 80 bb8b48cf041800f10b18c2213f0bc6dbea74dff5
child 82 db30cb1c7ff54c1bd67a18de38dc1c944fa06555
push id60
push userkgupta@mozilla.com
push dateFri, 26 Feb 2016 20:32:54 +0000
reviewersfelipe
bugs1251052
Bug 1251052 - Add a new experiment for tuning the displayport size. r=felipe
experiments/displayport-tuning-nightly/code/bootstrap.js
experiments/displayport-tuning-nightly/code/install.rdf
experiments/displayport-tuning-nightly/experiment.xpi
experiments/displayport-tuning-nightly/filter.js
experiments/displayport-tuning-nightly/manifest.json
new file mode 100644
--- /dev/null
+++ b/experiments/displayport-tuning-nightly/code/bootstrap.js
@@ -0,0 +1,89 @@
+let {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+
+Cu.import("resource:///modules/experiments/Experiments.jsm");
+Cu.import("resource://gre/modules/Task.jsm");
+Cu.import("resource://gre/modules/Preferences.jsm");
+
+var gStarted = false;
+
+const kSELF_ID = "displayport-tuning-nightly@experiments.mozilla.org";
+
+function startup() {
+  // Seems startup() function is launched twice after install, we're
+  // unsure why so far. We only want it to run once.
+  if (gStarted) {
+    return;
+  }
+  gStarted = true;
+
+  Task.spawn(function*() {
+    let branch = yield Experiments.instance().getExperimentBranch(kSELF_ID);
+    if (branch == null) {
+      let r = Math.random() * 6;
+      if (r < 1) {
+        branch = "control";
+      } else if (r < 2) {
+        branch = "group2";
+      } else if (r < 3) {
+        branch = "group3";
+      } else if (r < 4) {
+        branch = "group4";
+      } else if (r < 5) {
+        branch = "group5";
+      } else {
+        branch = "group6";
+      }
+      yield Experiments.instance().setExperimentBranch(kSELF_ID, branch);
+    }
+
+    let defaultPrefs = new Preferences({defaultBranch: true});
+    switch (branch) {
+      case "control":
+        return;
+      case "group2":
+        defaultPrefs.set("apz.x_skate_size_multiplier", "0.5");
+        defaultPrefs.set("apz.x_stationary_size_multiplier", "0.5");
+        return;
+      case "group3":
+        defaultPrefs.set("apz.y_skate_size_multiplier", "2.0");
+        defaultPrefs.set("apz.y_stationary_size_multiplier", "2.0");
+        return;
+      case "group4":
+        defaultPrefs.set("apz.y_skate_size_multiplier", "1.0");
+        defaultPrefs.set("apz.y_stationary_size_multiplier", "1.0");
+        return;
+      case "group5":
+        defaultPrefs.set("apz.y_skate_size_multiplier", "2.0");
+        return;
+      case "group6":
+        defaultPrefs.set("apz.y_skate_size_multiplier", "1.0");
+        return;
+      default:
+        throw new Error("Unexpected experiment branch: " + branch);
+    }
+  }).then(
+    function() {
+    },
+    function(e) {
+      Cu.reportError("Got error during bootstrap startup: " + e);
+    });
+}
+
+function shutdown(reason) {
+  if (reason != APP_SHUTDOWN) {
+    // when the add-on is being disabled/uninstalled
+    let defaultPrefs = new Preferences({defaultBranch: true});
+    defaultPrefs.reset("apz.x_skate_size_multiplier");
+    defaultPrefs.reset("apz.y_skate_size_multiplier");
+    defaultPrefs.reset("apz.x_stationary_size_multiplier");
+    defaultPrefs.reset("apz.y_stationary_size_multiplier");
+  }
+}
+
+function install() {
+  // no-op
+}
+
+function uninstall() {
+  // no-op
+}
new file mode 100644
--- /dev/null
+++ b/experiments/displayport-tuning-nightly/code/install.rdf
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+  <Description about="urn:mozilla:install-manifest">
+    <em:id>displayport-tuning-nightly@experiments.mozilla.org</em:id>
+    <em:version>1.0.0</em:version>
+    <em:type>128</em:type>
+    <em:bootstrap>true</em:bootstrap>
+    <em:unpack>false</em:unpack>
+
+    <!-- Firefox -->
+    <em:targetApplication>
+      <Description>
+        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+        <em:minVersion>47.0a1</em:minVersion>
+        <em:maxVersion>48.*</em:maxVersion>
+      </Description>
+    </em:targetApplication>
+
+    <!-- Front End MetaData -->
+    <em:name>DisplayPort Size Tuning</em:name>
+    <em:description>Measuring the effect of different displayport sizes on checkerboarding.</em:description>
+    <em:aboutURL>https://bugzilla.mozilla.org/show_bug.cgi?id=1251052</em:aboutURL>
+  </Description>
+</RDF>
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..1698f91bbcbd6012b3c906f4dccd202a917153c3
GIT binary patch
literal 3141
zc%1E)`9G9vAII-7qcKPmqGl|eq8ee6T_sDllClm4HOLlYsYb@0q{Z6Uh7vjwvW&GM
zW0_3COw&-=B1@*>q{V*ls9w)=>gYND!1G-9FV}s&Uf1WR&-?woEX;WML;(QU2++^l
z8@q4>^|tZ?z&-&05Cq`B89%?Ez@UKBI7P2OYbyxA8(YM*IZ@2CIgf_|8~A260Km7~
zB{qG&eaeEN3|m}S#*2GhmqLwgTpao^5g36=LuuY_cUZ|aR|{5uCA~4>!lVXgyq3D?
z@+ujRk2gM9smGsC4(rK9P(Ay33lS{4R+`-`RlD%hiN=U68meTr2fIsHJKIv)L@F7|
ztLLpl)0miBQc1zbR42^sNzNL3vix~bd(rLek&CY)Zi_sGJ3>O{2wZ403g#v56sgq+
zY8quh0@BMC%Pqu%wbXjGYAHIavz}jOZfuP*=(UOqHZSAWr(UWk8gqTm{&TrkEjJ@L
z(KL?E-05-{TZ)yx2_{+2ADC>$^5?vXHEYelketw_P}6Cb_9#a=EFWqdAIN@fS19E=
zpNZqNdUGMNq^_oI;wLuu%Se=rCqkxlwQyj%_wDPbGl_70yQzzXpa^C#OMk^_nk+74
zbZ8S;ck@}&wPUfwuI#cX<RO`wopvbwahNp^_o+gVO3165aue@~380<DXZjK1T>+s)
z@)o93;Wc*?gN~1wTF+LsxQz0v2o0%Jux9!YVzOJ}{yk8ZmC;cUae*h1+@LqLx?NRv
z<i)Zavq_wJWXl8&I#C7*sssgn5oLP>J36F(D3K&P?C(K_re!z;*%Zh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5P@{}&eLqtQQ^ROH`S{9UJ=
z{tO$dpmkLIU#I_DI^Dn{#rxkLxDvqEwbl$EKl1DDXS0I7KX?DupC1#~PxT)YF>5D3
zl@j!Q#{Wa$dguQbm<R%XH32~1C%`|%u4m@Q*n*9~F9-sCCum(N2>kUX-`Z!fcKAl%
H>)*csY>|Xz
new file mode 100644
--- /dev/null
+++ b/experiments/displayport-tuning-nightly/filter.js
@@ -0,0 +1,4 @@
+function filter(c) {
+  return c.telemetryEnvironment.settings.telemetryEnabled &&
+         c.telemetryEnvironment.settings.e10sEnabled;
+}
new file mode 100644
--- /dev/null
+++ b/experiments/displayport-tuning-nightly/manifest.json
@@ -0,0 +1,18 @@
+{
+  "publish"     : true,
+  "priority"    : 2,
+  "name"        : "DisplayPort Size Tuning",
+  "description" : "Measuring the effect of different displayport sizes on checkerboarding.",
+  "info"        : "<p><a href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=1251052\">Related bug</a></p>",
+  "manifest"    : {
+    "id"               : "displayport-tuning-nightly@experiments.mozilla.org",
+    "startTime"        : 1456365600,
+    "endTime"          : 1458352800,
+    "maxActiveSeconds" : 604800,
+    "appName"          : ["Firefox"],
+    "channel"          : ["nightly"],
+    "minVersion"       : "47.0a1",
+    "maxVersion"       : "48.*",
+    "sample"           : 0.5
+  }
+}