| Index: components/metrics/metrics_service.cc
|
| diff --git a/components/metrics/metrics_service.cc b/components/metrics/metrics_service.cc
|
| index 7e31ddb93156bf301ef333bd5cbe71bb7acc9691..e1a30b007ecb0c4de0d8bde11f0864be838c7284 100644
|
| --- a/components/metrics/metrics_service.cc
|
| +++ b/components/metrics/metrics_service.cc
|
| @@ -200,6 +200,9 @@ const size_t kUploadLogAvoidRetransmitSize = 100 * 1024;
|
| // Interval, in minutes, between state saves.
|
| const int kSaveStateIntervalMinutes = 5;
|
|
|
| +// Default sampling rate for UMA log uploads
|
| +const int kDefaultSamplingProbability = 100;
|
| +
|
| enum ResponseStatus {
|
| UNKNOWN_FAILURE,
|
| SUCCESS,
|
| @@ -235,12 +238,17 @@ void MarkAppCleanShutdownAndCommit(CleanExitBeacon* clean_exit_beacon,
|
| // Determines if current log should be sent based on sampling rate. Returns true
|
| // if the sampling rate is not set.
|
| bool ShouldUploadLog() {
|
| + std::string experiment_group =
|
| + base::FieldTrialList::FindFullName("UMA_EnableCellularLogUpload");
|
| + if (experiment_group.empty())
|
| + return true;
|
| +
|
| std::string probability_str = variations::GetVariationParamValue(
|
| "UMA_EnableCellularLogUpload", "Sample_Probability");
|
| + int probability;
|
| if (probability_str.empty())
|
| - return true;
|
| + probability = kDefaultSamplingProbability;
|
|
|
| - int probability;
|
| // In case specified sampling rate is invalid.
|
| if (!base::StringToInt(probability_str, &probability))
|
| return true;
|
|
|