Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 10317011: Associate variation IDs with uniformity trials. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: kUniformityBase = kMinID Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/metrics/variation_ids.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 1365f2fed8f854d7f09522045ead34dc2ded8534..4fac62168f5d3ab050fe2c7bbf70d612f4b94248 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -93,6 +93,7 @@
#include "chrome/common/json_pref_store.h"
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/logging_chrome.h"
+#include "chrome/common/metrics/experiments_helper.h"
#include "chrome/common/net/net_resource_provider.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/profiling.h"
@@ -1044,6 +1045,17 @@ void ChromeBrowserMainParts::SetupUniformityFieldTrials() {
// group. Each group will have a probability of 1/|trial_sizes[i]|.
const int trial_sizes[] = { 100, 20, 10, 5, 2 };
+ // Declare our variation ID bases along side this array so we can loop over it
+ // and assign the IDs appropriately. So for example, the 1 percent experiments
+ // should have a size of 100 (100/100 = 1).
+ const chrome_variations::ID trial_base_ids[] = {
+ chrome_variations::kUniformity1PercentBase,
+ chrome_variations::kUniformity5PercentBase,
+ chrome_variations::kUniformity10PercentBase,
+ chrome_variations::kUniformity20PercentBase,
+ chrome_variations::kUniformity50PercentBase
+ };
+
// Probability per group remains constant for all uniformity trials, what
// changes is the probability divisor.
static const base::FieldTrial::Probability kProbabilityPerGroup = 1;
@@ -1059,12 +1071,16 @@ void ChromeBrowserMainParts::SetupUniformityFieldTrials() {
scoped_refptr<base::FieldTrial> trial(
base::FieldTrialList::FactoryGetFieldTrial(
trial_name, divisor, "default", 2015, 1, 1, NULL));
+ experiments_helper::AssociateGoogleExperimentID(trial_name, "default",
+ trial_base_ids[i]);
// Loop starts with group 1 because the field trial automatically creates a
// default group, which would be group 0.
for (int group_number = 1; group_number < trial_sizes[i]; ++group_number) {
const std::string group_name = StringPrintf("group_%02d", group_number);
DVLOG(1) << " Group name = " << group_name;
trial->AppendGroup(group_name, kProbabilityPerGroup);
+ experiments_helper::AssociateGoogleExperimentID(trial_name, group_name,
+ static_cast<chrome_variations::ID>(trial_base_ids[i] + group_number));
}
}
}
« no previous file with comments | « no previous file | chrome/common/metrics/variation_ids.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698