| 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 #include "components/metrics/metrics_log.h" | 5 #include "components/metrics/metrics_log.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 if (version_mismatch_count) { | 290 if (version_mismatch_count) { |
| 291 local_state_->SetInteger(prefs::kStabilityVersionMismatchCount, 0); | 291 local_state_->SetInteger(prefs::kStabilityVersionMismatchCount, 0); |
| 292 UMA_STABILITY_HISTOGRAM_COUNTS_100( | 292 UMA_STABILITY_HISTOGRAM_COUNTS_100( |
| 293 "Stability.Internals.VersionMismatchCount", | 293 "Stability.Internals.VersionMismatchCount", |
| 294 version_mismatch_count); | 294 version_mismatch_count); |
| 295 } | 295 } |
| 296 } | 296 } |
| 297 | 297 |
| 298 void MetricsLog::RecordGeneralMetrics( | 298 void MetricsLog::RecordGeneralMetrics( |
| 299 const std::vector<MetricsProvider*>& metrics_providers) { | 299 const std::vector<MetricsProvider*>& metrics_providers) { |
| 300 if (local_state_->GetBoolean(prefs::kMetricsResetIds)) |
| 301 UMA_HISTOGRAM_BOOLEAN("UMA.IsClonedInstall", true); |
| 302 |
| 300 for (size_t i = 0; i < metrics_providers.size(); ++i) | 303 for (size_t i = 0; i < metrics_providers.size(); ++i) |
| 301 metrics_providers[i]->ProvideGeneralMetrics(uma_proto()); | 304 metrics_providers[i]->ProvideGeneralMetrics(uma_proto()); |
| 302 } | 305 } |
| 303 | 306 |
| 304 void MetricsLog::GetFieldTrialIds( | 307 void MetricsLog::GetFieldTrialIds( |
| 305 std::vector<ActiveGroupId>* field_trial_ids) const { | 308 std::vector<ActiveGroupId>* field_trial_ids) const { |
| 306 variations::GetFieldTrialActiveGroupIds(field_trial_ids); | 309 variations::GetFieldTrialActiveGroupIds(field_trial_ids); |
| 307 } | 310 } |
| 308 | 311 |
| 309 bool MetricsLog::HasEnvironment() const { | 312 bool MetricsLog::HasEnvironment() const { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 DCHECK(!closed_); | 460 DCHECK(!closed_); |
| 458 closed_ = true; | 461 closed_ = true; |
| 459 } | 462 } |
| 460 | 463 |
| 461 void MetricsLog::GetEncodedLog(std::string* encoded_log) { | 464 void MetricsLog::GetEncodedLog(std::string* encoded_log) { |
| 462 DCHECK(closed_); | 465 DCHECK(closed_); |
| 463 uma_proto_.SerializeToString(encoded_log); | 466 uma_proto_.SerializeToString(encoded_log); |
| 464 } | 467 } |
| 465 | 468 |
| 466 } // namespace metrics | 469 } // namespace metrics |
| OLD | NEW |