Chromium Code Reviews| Index: chrome/browser/metrics/metrics_log.cc |
| =================================================================== |
| --- chrome/browser/metrics/metrics_log.cc (revision 271296) |
| +++ chrome/browser/metrics/metrics_log.cc (working copy) |
| @@ -39,6 +39,7 @@ |
| #include "chrome/common/metrics/variations/variations_util.h" |
| #include "chrome/common/pref_names.h" |
| #include "chrome/installer/util/google_update_settings.h" |
| +#include "components/metrics/metrics_data_provider.h" |
| #include "components/metrics/proto/omnibox_event.pb.h" |
| #include "components/metrics/proto/profiler_event.pb.h" |
| #include "components/metrics/proto/system_profile.pb.h" |
| @@ -448,8 +449,10 @@ |
| return g_version_extension.Get(); |
| } |
| -void MetricsLog::RecordStabilityMetrics(base::TimeDelta incremental_uptime, |
| - base::TimeDelta uptime) { |
| +void MetricsLog::RecordStabilityMetrics( |
| + const ScopedVector<metrics::MetricsDataProvider>& data_providers, |
| + base::TimeDelta incremental_uptime, |
| + base::TimeDelta uptime) { |
| DCHECK(!locked()); |
| DCHECK(HasEnvironment()); |
| DCHECK(!HasStabilityMetrics()); |
| @@ -470,6 +473,11 @@ |
| // uma log upload, just as we send histogram data. |
| WriteRealtimeStabilityAttributes(pref, incremental_uptime, uptime); |
| + SystemProfileProto::Stability* stability = |
| + uma_proto()->mutable_system_profile()->mutable_stability(); |
| + for (size_t i = 0; i < data_providers.size(); ++i) |
| + data_providers[i]->ProvideStabilityMetrics(stability); |
| + |
| // Omit some stats unless this is the initial stability log. |
| if (log_type() != INITIAL_STABILITY_LOG) |
| return; |
| @@ -492,8 +500,6 @@ |
| // TODO(jar): The following are all optional, so we *could* optimize them for |
| // values of zero (and not include them). |
| - SystemProfileProto::Stability* stability = |
| - uma_proto()->mutable_system_profile()->mutable_stability(); |
| stability->set_incomplete_shutdown_count(incomplete_shutdown_count); |
| stability->set_breakpad_registration_success_count( |
| breakpad_registration_success_count); |
| @@ -503,6 +509,13 @@ |
| stability->set_debugger_not_present_count(debugger_not_present_count); |
| } |
| + |
|
Ilya Sherman
2014/05/19 14:45:00
nit: Spurious newline.
Alexei Svitkine (slow)
2014/05/19 15:23:02
Done.
|
| +void MetricsLog::RecordGeneralMetrics( |
| + const ScopedVector<metrics::MetricsDataProvider>& data_providers) { |
| + for (size_t i = 0; i < data_providers.size(); ++i) |
| + data_providers[i]->ProvideGeneralMetrics(uma_proto()); |
| +} |
| + |
| PrefService* MetricsLog::GetPrefService() { |
| return g_browser_process->local_state(); |
| } |
| @@ -689,6 +702,7 @@ |
| } |
| void MetricsLog::RecordEnvironment( |
| + const ScopedVector<metrics::MetricsDataProvider>& data_providers, |
| const std::vector<content::WebPluginInfo>& plugin_list, |
| const GoogleUpdateMetrics& google_update_metrics, |
| const std::vector<chrome_variations::ActiveGroupId>& synthetic_trials) { |
| @@ -795,6 +809,9 @@ |
| metrics_log_chromeos_->LogChromeOSMetrics(); |
| #endif // OS_CHROMEOS |
| + for (size_t i = 0; i < data_providers.size(); ++i) |
| + data_providers[i]->ProvideSystemProfileMetrics(system_profile); |
| + |
| std::string serialied_system_profile; |
| std::string base64_system_profile; |
| if (system_profile->SerializeToString(&serialied_system_profile)) { |