Chromium Code Reviews| 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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
| 6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
| 7 // | 7 // |
| 8 // OVERVIEW | 8 // OVERVIEW |
| 9 // | 9 // |
| 10 // A MetricsService instance is typically created at application startup. It is | 10 // A MetricsService instance is typically created at application startup. It is |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 879 } | 879 } |
| 880 if (!log_manager_.has_staged_log()) | 880 if (!log_manager_.has_staged_log()) |
| 881 log_manager_.StageNextLogForUpload(); | 881 log_manager_.StageNextLogForUpload(); |
| 882 | 882 |
| 883 // Proceed to stage the log for upload if log size satisfies cellular log | 883 // Proceed to stage the log for upload if log size satisfies cellular log |
| 884 // upload constrains. | 884 // upload constrains. |
| 885 if (client_->IsUMACellularUploadLogicEnabled() && | 885 if (client_->IsUMACellularUploadLogicEnabled() && |
| 886 !data_use_tracker_->ShouldUploadLogOnCellular( | 886 !data_use_tracker_->ShouldUploadLogOnCellular( |
| 887 log_manager_.staged_log_hash().size())) { | 887 log_manager_.staged_log_hash().size())) { |
| 888 scheduler_->UploadCancelled(); | 888 scheduler_->UploadCancelled(); |
| 889 UMA_HISTOGRAM_COUNTS("UMA.LogUpload.Canceled.CellularConstraint", 1); | |
|
Alexei Svitkine (slow)
2016/04/08 15:08:32
UMA_HISTOGRAM_COUNTS() allocated 50 buckets. You c
gayane -on leave until 09-2017
2016/04/08 17:19:25
I have added the false case here, but it wouldn't
| |
| 889 } else { | 890 } else { |
| 890 SendStagedLog(); | 891 SendStagedLog(); |
| 891 } | 892 } |
| 892 } | 893 } |
| 893 | 894 |
| 894 bool MetricsService::ProvidersHaveInitialStabilityMetrics() { | 895 bool MetricsService::ProvidersHaveInitialStabilityMetrics() { |
| 895 // Check whether any metrics provider has initial stability metrics. | 896 // Check whether any metrics provider has initial stability metrics. |
| 896 for (MetricsProvider* provider : metrics_providers_) { | 897 for (MetricsProvider* provider : metrics_providers_) { |
| 897 if (provider->HasInitialStabilityMetrics()) | 898 if (provider->HasInitialStabilityMetrics()) |
| 898 return true; | 899 return true; |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1183 base::Time::Now().ToTimeT()); | 1184 base::Time::Now().ToTimeT()); |
| 1184 } | 1185 } |
| 1185 | 1186 |
| 1186 void MetricsService::SkipAndDiscardUpload() { | 1187 void MetricsService::SkipAndDiscardUpload() { |
| 1187 log_manager_.DiscardStagedLog(); | 1188 log_manager_.DiscardStagedLog(); |
| 1188 scheduler_->UploadCancelled(); | 1189 scheduler_->UploadCancelled(); |
| 1189 log_upload_in_progress_ = false; | 1190 log_upload_in_progress_ = false; |
| 1190 } | 1191 } |
| 1191 | 1192 |
| 1192 } // namespace metrics | 1193 } // namespace metrics |
| OLD | NEW |