Bug 1394903 - Run a Telemetry experiment to vet the unaccelerated compositor process in Beta 56. r=felipe
authorAnthony Hughes <anthony.s.hughes@gmail.com>
Fri, 01 Sep 2017 20:53:08 -0300
changeset 133 a9f597a8c405
parent 132 6022f3f24315
child 134 b130b38531dc
push id104
push userfelipc@gmail.com
push date2017-09-01 23:53 +0000
reviewersfelipe
bugs1394903
Bug 1394903 - Run a Telemetry experiment to vet the unaccelerated compositor process in Beta 56. r=felipe
experiments/unaccelerated-compositor-process-beta56/code/bootstrap.js
experiments/unaccelerated-compositor-process-beta56/code/install.rdf
experiments/unaccelerated-compositor-process-beta56/experiment.xpi
experiments/unaccelerated-compositor-process-beta56/manifest.json
new file mode 100644
--- /dev/null
+++ b/experiments/unaccelerated-compositor-process-beta56/code/bootstrap.js
@@ -0,0 +1,103 @@
+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 = "unaccelerated-compositor-process-beta56@experiments.mozilla.org";
+const prefs = new Preferences();
+
+function startup() {
+  let branch = Experiments.instance().getExperimentBranch(kSELF_ID);
+  if (branch == null) {
+    checkForCompositor();
+  } else {
+    return;
+  }
+}
+
+function initializeExperiment() {
+  // 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() * 2;
+      if (r < 1) {
+        branch = "control";
+      } else {
+        branch = "disabled";
+        prefs.set("layers.gpu-process.allow-software", false);
+      }
+      yield Experiments.instance().setExperimentBranch(kSELF_ID, branch);
+    } else {
+      // Exclude the user if they've manually changed the pref
+      let pref = prefs.get("layers.gpu-process.allow-software");
+      let isBranchValid = true;
+      if (branch == "disabled") {
+        isBranchValid = (pref == false);
+      } else if (branch == "control") {
+        isBranchValid = (pref == true);
+      } else if (branch == "disqualified") {
+        isBranchValid = (pref == true);
+      }
+      if (!isBranchValid) {
+        branch = "usermod";
+        yield Experiments.instance().setExperimentBranch(kSELF_ID, branch);
+      }
+    }
+  }).then(
+    function() {
+    },
+    function(e) {
+      Cu.reportError("Got error during bootstrap startup: " + e);
+    });
+}
+
+function shutdown(data, reason) {
+  if (reason == ADDON_DISABLE || reason == ADDON_UNINSTALL) {
+    // when the add-on is being disabled/uninstalled
+    prefs.reset("layers.gpu-process.allow-software");
+  }
+}
+
+function install() {
+  checkForCompositor();
+}
+
+function uninstall() {
+  prefs.reset("layers.gpu-process.allow-software");
+}
+
+function checkForCompositor() {
+  let gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
+  let gfxFeatures = gfxInfo.getFeatures();
+  let compositor = gfxFeatures.hasOwnProperty("compositor")
+                   ? gfxFeatures.compositor
+                   : "none";
+  if (compositor != "none") {
+    if (compositor == "basic") {
+      initializeExperiment();
+    } else {
+      Experiments.instance().setExperimentBranch(kSELF_ID, "disqualified").then(null, Cu.reportError);
+    }
+  } else {
+    let listener = function (subject, topic) {
+      let gfxFeatures = gfxInfo.getFeatures();
+      if (gfxFeatures.compositor == "basic") {
+        initializeExperiment();
+      } else {
+        Experiments.instance().setExperimentBranch(kSELF_ID, "disqualified").then(null, Cu.reportError);
+      }
+      Services.obs.removeObserver(listener, "compositor:created");
+    };
+    Services.obs.addObserver(listener, "compositor:created", false);
+  }
+}
new file mode 100644
--- /dev/null
+++ b/experiments/unaccelerated-compositor-process-beta56/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>unaccelerated-compositor-process-beta56@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>56.0</em:minVersion>
+        <em:maxVersion>56.0</em:maxVersion>
+      </Description>
+    </em:targetApplication>
+
+    <!-- Front End MetaData -->
+    <em:name>Unaccelerated Compositor Process Beta 56</em:name>
+    <em:description>Measures the impact of enabling compositor process for users without hardware acceleration in Firefox Beta 56 on Windows</em:description>
+    <em:aboutURL>https://bugzilla.mozilla.org/show_bug.cgi?id=1356091</em:aboutURL>
+  </Description>
+</RDF>
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..27d5828fe2dca0e0135a50dbadc779fe23c4cdf2
GIT binary patch
literal 5926
zc$}43Wl$W-vR+u+-GXe8g+Oq33BetLyDx#o6M`%nd;<q3z(Qbghd^)wN$`c>u0ewZ
z3BKW-JgM{UsdInao|>BKsj083r@yN1{`53~SX2N201qH8%A&a#qsB~23;=|X0RX>m
zwVxU(@~Z2o@OyX$LfqZ$_<VfrmQ7rY3=<l_ufO8wg0wZT6wL=ntg!a1+6tH-Mbk;)
zN3AGhV(C?Yo(86p7*OdcAh}dA$jOtzPm9Z__O$tTW&3@{ZckvHKWEzRFFuqWWX}t)
zR$&Z0{v{wK7|-XFfUgW3<!F=uI?@CQ;6>R1c5SCNM#u!jMX5jj(8N#EbhgAAnDPbC
zp9;}p;)M4IB*T@`Aj}`nGihSizjD3bkD-jkriunwWH|%?j@T5E6zC{`xt3P-YQ(IA
zd1}3ZlH~YwB4JV~LZGPov<i9#Hf^=fl`Ac5*vQsYU{Bmym`HzWaIRMX5sm^2y#g8Q
zQRt(0GNIh>yiC;(rYn^rN|B4Yo+-*HKoy+i8y;mTvi9U1T@wUXVSDM7E;|3BBGi06
z77Ad&rBq?oOYXBpIw6Y%yL|=J)tQvmR>|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#Z(cw#3Irb3o_cJ{<V`^0iG{-x}Ae}h9r9&U|)D=G#1A0uuHMWo03K6XiCP0
z{PUpf!p*?Py^PswHvDM~eQr1Vxv0gvmPNG&d-X=moNhu*-L~YGpsf?1hnJNNqn&mz
zxfhrr)r6w!?-ClNLxKMq_BKo4z1yGOt3Nm8KZ%~c&V-{{W15d2@oG#HYw~iBj*K-L
z2uumDo%#z-`wwdA^74)U)E*hu0t!`8rN}gBkMs_)5^zTdpHJR(^b%S<rT}_)v_{A>
z5(}o|Qbn17Ro~KPJGNspNX8)BVxn+&RA03quQnHbyfFZJni!Z=z<;mE{-1?m0RD|W
z`x`+X`0rbh|1nS)GF<&n-2bpK`TyYmRFwV#&m{%?$0h3T!T+6*e+B=G@}KGXcZ9#^
c_Ai8=RR5T1Jxy$!-w&|=T)+P~nfkZ)UjTB<Z2$lO
new file mode 100644
--- /dev/null
+++ b/experiments/unaccelerated-compositor-process-beta56/manifest.json
@@ -0,0 +1,19 @@
+{
+  "publish"     : true,
+  "priority"    : 2,
+  "name"        : "Unaccelerated Compositor Process Beta 56",
+  "description" : "Measures the impact of enabling compositor process for users without hardware acceleration in Firefox Beta 56 on Windows",
+  "info"        : "<p><a href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=1356091\">Related bug</a></p>",
+  "manifest"    : {
+    "id"               : "unaccelerated-compositor-process-beta56@experiments.mozilla.org",
+    "startTime"        : 1503878400,
+    "endTime"          : 1505865600,
+    "maxActiveSeconds" : 864000,
+    "appName"          : ["Firefox"],
+    "channel"          : ["beta"],
+    "minVersion"       : "56.0",
+    "maxVersion"       : "56.0",
+    "os"               : ["WINNT"],
+    "sample"           : 0.25
+  }
+}