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 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1100 | 1100 |
1101 void MetricsService::RecordCurrentEnvironment(MetricsLog* log) { | 1101 void MetricsService::RecordCurrentEnvironment(MetricsLog* log) { |
1102 std::vector<variations::ActiveGroupId> synthetic_trials; | 1102 std::vector<variations::ActiveGroupId> synthetic_trials; |
1103 GetSyntheticFieldTrialsOlderThan(log->creation_time(), &synthetic_trials); | 1103 GetSyntheticFieldTrialsOlderThan(log->creation_time(), &synthetic_trials); |
1104 log->RecordEnvironment(metrics_providers_.get(), synthetic_trials, | 1104 log->RecordEnvironment(metrics_providers_.get(), synthetic_trials, |
1105 GetInstallDate(), GetMetricsReportingEnabledDate()); | 1105 GetInstallDate(), GetMetricsReportingEnabledDate()); |
1106 } | 1106 } |
1107 | 1107 |
1108 void MetricsService::RecordCurrentHistograms() { | 1108 void MetricsService::RecordCurrentHistograms() { |
1109 DCHECK(log_manager_.current_log()); | 1109 DCHECK(log_manager_.current_log()); |
1110 histogram_snapshot_manager_.StartDeltas(); | |
1111 for (size_t i = 0; i < metrics_providers_.size(); ++i) { | |
grt (UTC plus 2)
2016/02/08 18:09:19
will this work:
for (auto& provider : metrics_pr
bcwhite
2016/02/09 21:08:46
Seems to work. I'll updated it elsewhere in the f
| |
1112 metrics_providers_[i]->RecordHistogramSnapshots( | |
1113 &histogram_snapshot_manager_); | |
1114 } | |
1115 histogram_snapshot_manager_.FinishDeltas(); | |
1110 } | 1116 } |
1111 | 1117 |
1112 void MetricsService::RecordCurrentStabilityHistograms() { | 1118 void MetricsService::RecordCurrentStabilityHistograms() { |
1113 DCHECK(log_manager_.current_log()); | 1119 DCHECK(log_manager_.current_log()); |
1114 // "true" indicates that StatisticsRecorder should include histograms in | 1120 // "true" indicates that StatisticsRecorder should include histograms in |
1115 // persistent storage. | 1121 // persistent storage. |
1116 histogram_snapshot_manager_.PrepareDeltas( | 1122 histogram_snapshot_manager_.PrepareDeltas( |
1117 base::StatisticsRecorder::begin(true), base::StatisticsRecorder::end(), | 1123 base::StatisticsRecorder::begin(true), base::StatisticsRecorder::end(), |
1118 base::Histogram::kNoFlags, base::Histogram::kUmaStabilityHistogramFlag); | 1124 base::Histogram::kNoFlags, base::Histogram::kUmaStabilityHistogramFlag); |
1119 } | 1125 } |
(...skipping 27 matching lines...) Expand all Loading... | |
1147 base::Time::Now().ToTimeT()); | 1153 base::Time::Now().ToTimeT()); |
1148 } | 1154 } |
1149 | 1155 |
1150 void MetricsService::SkipAndDiscardUpload() { | 1156 void MetricsService::SkipAndDiscardUpload() { |
1151 log_manager_.DiscardStagedLog(); | 1157 log_manager_.DiscardStagedLog(); |
1152 scheduler_->UploadCancelled(); | 1158 scheduler_->UploadCancelled(); |
1153 log_upload_in_progress_ = false; | 1159 log_upload_in_progress_ = false; |
1154 } | 1160 } |
1155 | 1161 |
1156 } // namespace metrics | 1162 } // namespace metrics |
OLD | NEW |