Bug 1359495 - Change the process scheme to better test what we intend on releasing. r=Felipe
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 25 Apr 2017 14:00:46 -0700
changeset 354826 35e9b30a0497a664da2f8eb5bb4cebf0780b5cb4
parent 354825 d83907ea33abff72b189ad08d055494b6e7866e1
child 354827 4bac91d1534954928147ad23081e73c7b91161ef
push id41477
push usermrbkap@mozilla.com
push dateTue, 25 Apr 2017 21:44:38 +0000
treeherderautoland@35e9b30a0497 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1359495
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1359495 - Change the process scheme to better test what we intend on releasing. r=Felipe This patch also moves the BUCKETS into a per-update-channel constant object at the top of the file to allow for more easily configurable experiments on multiple update channels running at once. MozReview-Commit-ID: 9HTu5ssz4sG
browser/extensions/e10srollout/bootstrap.js
browser/extensions/e10srollout/install.rdf.in
--- a/browser/extensions/e10srollout/bootstrap.js
+++ b/browser/extensions/e10srollout/bootstrap.js
@@ -6,23 +6,29 @@
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/UpdateUtils.jsm");
 Cu.import("resource://gre/modules/AppConstants.jsm");
 
- // The amount of people to be part of e10s
+// The amount of people to be part of e10s
 const TEST_THRESHOLD = {
   "beta": 0.9,  // 90%
   "release": 1.0,  // 100%
   "esr": 1.0,  // 100%
 };
 
+// If a user qualifies for the e10s-multi experiement, this is how many
+// content processes to use.
+const MULTI_BUCKETS = {
+  "beta": { 1: .5, 4: 1, },
+};
+
 const ADDON_ROLLOUT_POLICY = {
   "beta": "50allmpc",
   "release": "50allmpc",
   "esr": "esrA", // WebExtensions and Addons with mpc=true
 };
 
 if (AppConstants.RELEASE_OR_BETA) {
   // Bug 1348576 - e10s is never enabled for non-official release builds
@@ -115,24 +121,24 @@ function defineCohort() {
 
   let cohortPrefix = "";
   if (disqualified) {
     cohortPrefix = "disqualified-";
   } else if (hasNonExemptAddon) {
     cohortPrefix = `addons-set${addonPolicy}-`;
   }
 
-  let inMultiExperiment = false;
+  let eligibleForMulti = false;
   if (userOptedOut.e10s || userOptedOut.multi) {
     // If we detected that the user opted out either for multi or e10s, then
     // the proper prefs must already be set.
     setCohort("optedOut");
   } else if (userOptedIn.e10s) {
     setCohort("optedIn");
-    inMultiExperiment = true;
+    eligibleForMulti = true;
   } else if (temporaryDisqualification != "") {
     // Users who are disqualified by the backend (from multiprocessBlockPolicy)
     // can be put into either the test or control groups, because e10s will
     // still be denied by the backend, which is useful so that the E10S_STATUS
     // telemetry probe can be correctly set.
 
     // For these volatile disqualification reasons, however, we must not try
     // to activate e10s because the backend doesn't know about it. E10S_STATUS
@@ -142,63 +148,58 @@ function defineCohort() {
     Preferences.reset(PREF_E10S_PROCESSCOUNT + ".web");
   } else if (!disqualified && testThreshold < 1.0 &&
              temporaryQualification != "") {
     // Users who are qualified for e10s and on channels where some population
     // would not receive e10s can be pushed into e10s anyway via a temporary
     // qualification which overrides the user sample value when non-empty.
     setCohort(`temp-qualified-${temporaryQualification}`);
     Preferences.set(PREF_TOGGLE_E10S, true);
-    inMultiExperiment = true;
+    eligibleForMulti = true;
   } else if (testGroup) {
     setCohort(`${cohortPrefix}test`);
     Preferences.set(PREF_TOGGLE_E10S, true);
-    inMultiExperiment = true;
+    eligibleForMulti = true;
   } else {
     setCohort(`${cohortPrefix}control`);
     Preferences.reset(PREF_TOGGLE_E10S);
     Preferences.reset(PREF_E10S_PROCESSCOUNT + ".web");
   }
 
   // Now determine if this user should be in the e10s-multi experiment.
-  // - We only run the experiment on the beta channel.
+  // - We only run the experiment on channels defined in MULTI_BUCKETS.
   // - We decided above whether this user qualifies for the experiment.
   // - If the user already opted into multi, then their prefs are already set
   //   correctly, we're done.
   // - If the user has addons that disqualify them for multi, leave them with
   //   the default number of content processes (1 on beta) but still in the
   //   test cohort.
-  if (updateChannel !== "beta" ||
-      !inMultiExperiment ||
+  if (!(updateChannel in MULTI_BUCKETS) ||
+      !eligibleForMulti ||
       userOptedIn.multi ||
       disqualified ||
       getAddonsDisqualifyForMulti()) {
     Preferences.reset(PREF_E10S_PROCESSCOUNT + ".web");
     return;
   }
 
   // If we got here with a cohortPrefix, it must be "addons-set50allmpc-",
   // and we know because of getAddonsDisqualifyForMulti that the addons that
   // are installed must be web extensions.
   if (cohortPrefix) {
     cohortPrefix = "webextensions-";
   }
 
   // The user is in the multi experiment!
   // Decide how many content processes to use for this user.
-  let BUCKETS = {
-    1: .25,
-    2: .5,
-    4: .75,
-    8: 1
-  };
+  let buckets = MULTI_BUCKETS[updateChannel];
 
   let multiUserSample = getUserSample(true);
-  for (let sampleName of Object.getOwnPropertyNames(BUCKETS)) {
-    if (multiUserSample < BUCKETS[sampleName]) {
+  for (let sampleName of Object.getOwnPropertyNames(buckets)) {
+    if (multiUserSample < buckets[sampleName]) {
       setCohort(`${cohortPrefix}multiBucket${sampleName}`);
       Preferences.set(PREF_E10S_PROCESSCOUNT + ".web", sampleName);
       break;
     }
   }
 }
 
 function shutdown(data, reason) {
--- a/browser/extensions/e10srollout/install.rdf.in
+++ b/browser/extensions/e10srollout/install.rdf.in
@@ -5,17 +5,17 @@
 
 #filter substitution
 
 <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>e10srollout@mozilla.org</em:id>
-    <em:version>1.15</em:version>
+    <em:version>1.50</em:version>
     <em:type>2</em:type>
     <em:bootstrap>true</em:bootstrap>
     <em:multiprocessCompatible>true</em:multiprocessCompatible>
 
     <!-- Target Application this theme can install into,
         with minimum and maximum supported versions. -->
     <em:targetApplication>
       <Description>