OLD | NEW |
---|---|
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 // FieldTrial is a class for handling details of statistical experiments | 5 // FieldTrial is a class for handling details of statistical experiments |
6 // performed by actual users in the field (i.e., in a shipped or beta product). | 6 // performed by actual users in the field (i.e., in a shipped or beta product). |
7 // All code is called exclusively on the UI thread currently. | 7 // All code is called exclusively on the UI thread currently. |
8 // | 8 // |
9 // The simplest example is an experiment to see whether one of two options | 9 // The simplest example is an experiment to see whether one of two options |
10 // produces "better" results across our user population. In that scenario, UMA | 10 // produces "better" results across our user population. In that scenario, UMA |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 // if the group's name is empty, a name of "_" concatenated with the group | 109 // if the group's name is empty, a name of "_" concatenated with the group |
110 // number is used as the group name. | 110 // number is used as the group name. |
111 std::string group_name() const { return group_name_; } | 111 std::string group_name() const { return group_name_; } |
112 | 112 |
113 // Helper function for the most common use: as an argument to specifiy the | 113 // Helper function for the most common use: as an argument to specifiy the |
114 // name of a HISTOGRAM. Use the original histogram name as the name_prefix. | 114 // name of a HISTOGRAM. Use the original histogram name as the name_prefix. |
115 static std::string MakeName(const std::string& name_prefix, | 115 static std::string MakeName(const std::string& name_prefix, |
116 const std::string& trial_name); | 116 const std::string& trial_name); |
117 | 117 |
118 private: | 118 private: |
119 friend class base::RefCounted<FieldTrial>; | |
120 | |
121 virtual ~FieldTrial() {} | |
M-A Ruel
2009/11/05 20:31:28
why virtual?
jam
2009/11/05 21:52:37
Done.
| |
122 | |
119 // The name of the field trial, as can be found via the FieldTrialList. | 123 // The name of the field trial, as can be found via the FieldTrialList. |
120 // This is empty of the trial is not in the experiment. | 124 // This is empty of the trial is not in the experiment. |
121 const std::string name_; | 125 const std::string name_; |
122 | 126 |
123 // The maximu sum of all probabilities supplied, which corresponds to 100%. | 127 // The maximu sum of all probabilities supplied, which corresponds to 100%. |
124 // This is the scaling factor used to adjust supplied probabilities. | 128 // This is the scaling factor used to adjust supplied probabilities. |
125 Probability divisor_; | 129 Probability divisor_; |
126 | 130 |
127 // The randomly selected probability that is used to select a group (or have | 131 // The randomly selected probability that is used to select a group (or have |
128 // the instance not participate). It is the product of divisor_ and a random | 132 // the instance not participate). It is the product of divisor_ and a random |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 | 225 |
222 // Lock for access to registered_. | 226 // Lock for access to registered_. |
223 Lock lock_; | 227 Lock lock_; |
224 RegistrationList registered_; | 228 RegistrationList registered_; |
225 | 229 |
226 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); | 230 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); |
227 }; | 231 }; |
228 | 232 |
229 #endif // BASE_FIELD_TRIAL_H_ | 233 #endif // BASE_FIELD_TRIAL_H_ |
230 | 234 |
OLD | NEW |