OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/common/variations/uniformity_field_trials.h" | 5 #include "chrome/common/variations/uniformity_field_trials.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "chrome/common/variations/variation_ids.h" | |
13 #include "components/variations/variations_associated_data.h" | 12 #include "components/variations/variations_associated_data.h" |
14 | 13 |
15 namespace chrome_variations { | 14 namespace chrome_variations { |
16 | 15 |
17 namespace { | 16 namespace { |
18 | 17 |
| 18 const int MINIMIUM_ID = 3300000; |
| 19 |
| 20 const int UNIFORMITY_1_PERCENT_BASE = MINIMIUM_ID; |
| 21 const int UNIFORMITY_1_PERCENT_LIMIT = UNIFORMITY_1_PERCENT_BASE + 100; |
| 22 const int UNIFORMITY_5_PERCENT_BASE = UNIFORMITY_1_PERCENT_LIMIT; |
| 23 const int UNIFORMITY_5_PERCENT_LIMIT = UNIFORMITY_5_PERCENT_BASE + 20; |
| 24 const int UNIFORMITY_10_PERCENT_BASE = UNIFORMITY_5_PERCENT_LIMIT; |
| 25 const int UNIFORMITY_10_PERCENT_LIMIT = UNIFORMITY_10_PERCENT_BASE + 10; |
| 26 const int UNIFORMITY_20_PERCENT_BASE = UNIFORMITY_10_PERCENT_LIMIT; |
| 27 const int UNIFORMITY_20_PERCENT_LIMIT = UNIFORMITY_20_PERCENT_BASE + 5; |
| 28 const int UNIFORMITY_50_PERCENT_BASE = UNIFORMITY_20_PERCENT_LIMIT; |
| 29 // A uniformity trial used to compare one-time-randomized and |
| 30 // session-randomized FieldTrials. |
| 31 const int UNIFORMITY_SESSION_RANDOMIZED_5_PERCENT_BASE = 3300139; |
| 32 |
19 // Set up a uniformity field trial. |one_time_randomized| indicates if the | 33 // Set up a uniformity field trial. |one_time_randomized| indicates if the |
20 // field trial is one-time randomized or session-randomized. |trial_name_string| | 34 // field trial is one-time randomized or session-randomized. |trial_name_string| |
21 // must contain a "%d" since the percentage of the group will be inserted in | 35 // must contain a "%d" since the percentage of the group will be inserted in |
22 // the trial name. |num_trial_groups| must be a divisor of 100 (e.g. 5, 20) | 36 // the trial name. |num_trial_groups| must be a divisor of 100 (e.g. 5, 20) |
23 void SetupSingleUniformityFieldTrial( | 37 void SetupSingleUniformityFieldTrial( |
24 base::FieldTrial::RandomizationType randomization_type, | 38 base::FieldTrial::RandomizationType randomization_type, |
25 const std::string& trial_name_string, | 39 const std::string& trial_name_string, |
26 const variations::VariationID trial_base_id, | 40 const variations::VariationID trial_base_id, |
27 int num_trial_groups) { | 41 int num_trial_groups) { |
28 // Probability per group remains constant for all uniformity trials, what | 42 // Probability per group remains constant for all uniformity trials, what |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 const std::string kSessionRandomizedTrialName = | 139 const std::string kSessionRandomizedTrialName = |
126 "UMA-Session-Randomized-Uniformity-Trial-%d-Percent"; | 140 "UMA-Session-Randomized-Uniformity-Trial-%d-Percent"; |
127 SetupSingleUniformityFieldTrial( | 141 SetupSingleUniformityFieldTrial( |
128 base::FieldTrial::SESSION_RANDOMIZED, kSessionRandomizedTrialName, | 142 base::FieldTrial::SESSION_RANDOMIZED, kSessionRandomizedTrialName, |
129 UNIFORMITY_SESSION_RANDOMIZED_5_PERCENT_BASE, 20); | 143 UNIFORMITY_SESSION_RANDOMIZED_5_PERCENT_BASE, 20); |
130 | 144 |
131 SetupNewInstallUniformityTrial(install_date); | 145 SetupNewInstallUniformityTrial(install_date); |
132 } | 146 } |
133 | 147 |
134 } // namespace chrome_variations | 148 } // namespace chrome_variations |
OLD | NEW |