| 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 #ifndef COMPONENTS_VARIATIONS_VARIATIONS_SEED_SIMULATOR_H_ | 5 #ifndef COMPONENTS_VARIATIONS_VARIATIONS_SEED_SIMULATOR_H_ |
| 6 #define COMPONENTS_VARIATIONS_VARIATIONS_SEED_SIMULATOR_H_ | 6 #define COMPONENTS_VARIATIONS_VARIATIONS_SEED_SIMULATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 int kill_best_effort_group_change_count; | 37 int kill_best_effort_group_change_count; |
| 38 | 38 |
| 39 // The number of expected group changes that fall in the category of killed | 39 // The number of expected group changes that fall in the category of killed |
| 40 // experiments that should trigger the "critical" restart mechanism. | 40 // experiments that should trigger the "critical" restart mechanism. |
| 41 int kill_critical_group_change_count; | 41 int kill_critical_group_change_count; |
| 42 | 42 |
| 43 Result(); | 43 Result(); |
| 44 ~Result(); | 44 ~Result(); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 // Creates the simulator with the given entropy |provider|. | 47 // Creates the simulator with the given default and low entropy providers. The |
| 48 explicit VariationsSeedSimulator( | 48 // |low_entropy_provider| will be used for studies that should only use a low |
| 49 const base::FieldTrial::EntropyProvider& provider); | 49 // entropy source. This is defined by |
| 50 // VariationsSeedProcessor::ShouldStudyUseLowEntropy, in |
| 51 // variations_seed_processor.h. |
| 52 VariationsSeedSimulator( |
| 53 const base::FieldTrial::EntropyProvider& default_entropy_provider, |
| 54 const base::FieldTrial::EntropyProvider& low_entropy_provider); |
| 50 virtual ~VariationsSeedSimulator(); | 55 virtual ~VariationsSeedSimulator(); |
| 51 | 56 |
| 52 // Computes differences between the current process' field trial state and | 57 // Computes differences between the current process' field trial state and |
| 53 // the result of evaluating |seed| with the given parameters. Returns the | 58 // the result of evaluating |seed| with the given parameters. Returns the |
| 54 // results of the simulation as a set of expected group change counts of each | 59 // results of the simulation as a set of expected group change counts of each |
| 55 // type. | 60 // type. |
| 56 Result SimulateSeedStudies(const VariationsSeed& seed, | 61 Result SimulateSeedStudies(const VariationsSeed& seed, |
| 57 const std::string& locale, | 62 const std::string& locale, |
| 58 const base::Time& reference_date, | 63 const base::Time& reference_date, |
| 59 const base::Version& version, | 64 const base::Version& version, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 90 ChangeType PermanentStudyGroupChanged(const ProcessedStudy& processed_study, | 95 ChangeType PermanentStudyGroupChanged(const ProcessedStudy& processed_study, |
| 91 const std::string& selected_group); | 96 const std::string& selected_group); |
| 92 | 97 |
| 93 // For the given |processed_study| with SESSION consistency, determines if | 98 // For the given |processed_study| with SESSION consistency, determines if |
| 94 // there are enough changes in the study config that restarting will result | 99 // there are enough changes in the study config that restarting will result |
| 95 // in a guaranteed different group assignment (or different params) and | 100 // in a guaranteed different group assignment (or different params) and |
| 96 // returns the corresponding ChangeType. | 101 // returns the corresponding ChangeType. |
| 97 ChangeType SessionStudyGroupChanged(const ProcessedStudy& filtered_study, | 102 ChangeType SessionStudyGroupChanged(const ProcessedStudy& filtered_study, |
| 98 const std::string& selected_group); | 103 const std::string& selected_group); |
| 99 | 104 |
| 100 const base::FieldTrial::EntropyProvider& entropy_provider_; | 105 const base::FieldTrial::EntropyProvider& default_entropy_provider_; |
| 106 const base::FieldTrial::EntropyProvider& low_entropy_provider_; |
| 101 | 107 |
| 102 DISALLOW_COPY_AND_ASSIGN(VariationsSeedSimulator); | 108 DISALLOW_COPY_AND_ASSIGN(VariationsSeedSimulator); |
| 103 }; | 109 }; |
| 104 | 110 |
| 105 } // namespace variations | 111 } // namespace variations |
| 106 | 112 |
| 107 #endif // COMPONENTS_VARIATIONS_VARIATIONS_SEED_SIMULATOR_H_ | 113 #endif // COMPONENTS_VARIATIONS_VARIATIONS_SEED_SIMULATOR_H_ |
| OLD | NEW |