Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 386 const int year, | 386 const int year, |
| 387 const int month, | 387 const int month, |
| 388 const int day_of_month, | 388 const int day_of_month, |
| 389 FieldTrial::RandomizationType randomization_type, | 389 FieldTrial::RandomizationType randomization_type, |
| 390 int* default_group_number); | 390 int* default_group_number); |
| 391 | 391 |
| 392 // Same as FactoryGetFieldTrial(), but allows specifying a custom seed to be | 392 // Same as FactoryGetFieldTrial(), but allows specifying a custom seed to be |
| 393 // used on one-time randomized field trials (instead of a hash of the trial | 393 // used on one-time randomized field trials (instead of a hash of the trial |
| 394 // name, which is used otherwise or if |randomization_seed| has value 0). The | 394 // name, which is used otherwise or if |randomization_seed| has value 0). The |
| 395 // |randomization_seed| value (other than 0) should never be the same for two | 395 // |randomization_seed| value (other than 0) should never be the same for two |
| 396 // trials, else this would result in correlated group assignments. | 396 // trials, else this would result in correlated group assignments. Note: |
| 397 // Note: Using a custom randomization seed is only supported by the | 397 // Using a custom randomization seed is only supported by the |
| 398 // PermutedEntropyProvider (which is used when UMA is not enabled). | 398 // PermutedEntropyProvider (which is used when UMA is not enabled). If |
| 399 // |override_entropy_provider| is not NULL, then it will be used for | |
|
Alexei Svitkine (slow)
2016/05/17 16:31:35
Nit: not NULL -> not null
jwd
2016/05/18 13:24:18
Done.
| |
| 400 // randomization instead of the provider given when the FieldTrialList was | |
| 401 // instanciated. | |
| 399 static FieldTrial* FactoryGetFieldTrialWithRandomizationSeed( | 402 static FieldTrial* FactoryGetFieldTrialWithRandomizationSeed( |
| 400 const std::string& trial_name, | 403 const std::string& trial_name, |
| 401 FieldTrial::Probability total_probability, | 404 FieldTrial::Probability total_probability, |
| 402 const std::string& default_group_name, | 405 const std::string& default_group_name, |
| 403 const int year, | 406 const int year, |
| 404 const int month, | 407 const int month, |
| 405 const int day_of_month, | 408 const int day_of_month, |
| 406 FieldTrial::RandomizationType randomization_type, | 409 FieldTrial::RandomizationType randomization_type, |
| 407 uint32_t randomization_seed, | 410 uint32_t randomization_seed, |
| 408 int* default_group_number); | 411 int* default_group_number, |
| 412 const FieldTrial::EntropyProvider* override_entropy_provider); | |
| 409 | 413 |
| 410 // The Find() method can be used to test to see if a named trial was already | 414 // The Find() method can be used to test to see if a named trial was already |
| 411 // registered, or to retrieve a pointer to it from the global map. | 415 // registered, or to retrieve a pointer to it from the global map. |
| 412 static FieldTrial* Find(const std::string& trial_name); | 416 static FieldTrial* Find(const std::string& trial_name); |
| 413 | 417 |
| 414 // Returns the group number chosen for the named trial, or | 418 // Returns the group number chosen for the named trial, or |
| 415 // FieldTrial::kNotFinalized if the trial does not exist. | 419 // FieldTrial::kNotFinalized if the trial does not exist. |
| 416 static int FindValue(const std::string& trial_name); | 420 static int FindValue(const std::string& trial_name); |
| 417 | 421 |
| 418 // Returns the group name chosen for the named trial, or the empty string if | 422 // Returns the group name chosen for the named trial, or the empty string if |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 532 | 536 |
| 533 // List of observers to be notified when a group is selected for a FieldTrial. | 537 // List of observers to be notified when a group is selected for a FieldTrial. |
| 534 scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; | 538 scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; |
| 535 | 539 |
| 536 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); | 540 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); |
| 537 }; | 541 }; |
| 538 | 542 |
| 539 } // namespace base | 543 } // namespace base |
| 540 | 544 |
| 541 #endif // BASE_METRICS_FIELD_TRIAL_H_ | 545 #endif // BASE_METRICS_FIELD_TRIAL_H_ |
| OLD | NEW |