Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: components/metrics/stability_metrics_helper.cc

Issue 2130753004: Add renderer launch count to stability metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: do not report on chromecast Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/metrics/stability_metrics_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/stability_metrics_helper.cc
diff --git a/components/metrics/stability_metrics_helper.cc b/components/metrics/stability_metrics_helper.cc
index 7b771f9f4d54c6610aa0a96518650bfc6969d025..8adcb226bd31339aa2be6ff44bf4369ae18e219f 100644
--- a/components/metrics/stability_metrics_helper.cc
+++ b/components/metrics/stability_metrics_helper.cc
@@ -95,6 +95,12 @@ void StabilityMetricsHelper::ProvideStabilityMetrics(
local_state_->SetInteger(prefs::kStabilityRendererFailedLaunchCount, 0);
}
+ count = local_state_->GetInteger(prefs::kStabilityRendererLaunchCount);
+ if (count) {
+ stability_proto->set_renderer_launch_count(count);
+ local_state_->SetInteger(prefs::kStabilityRendererLaunchCount, 0);
+ }
+
count =
local_state_->GetInteger(prefs::kStabilityExtensionRendererCrashCount);
if (count) {
@@ -115,6 +121,12 @@ void StabilityMetricsHelper::ProvideStabilityMetrics(
stability_proto->set_renderer_hang_count(count);
local_state_->SetInteger(prefs::kStabilityRendererHangCount, 0);
}
+
+ count = local_state_->GetInteger(prefs::kStabilityRendererLaunchCount);
+ if (count) {
+ stability_proto->set_renderer_launch_count(count);
+ local_state_->SetInteger(prefs::kStabilityRendererLaunchCount, 0);
+ }
}
void StabilityMetricsHelper::ClearSavedStabilityMetrics() {
@@ -124,10 +136,12 @@ void StabilityMetricsHelper::ClearSavedStabilityMetrics() {
local_state_->SetInteger(prefs::kStabilityExtensionRendererCrashCount, 0);
local_state_->SetInteger(prefs::kStabilityExtensionRendererFailedLaunchCount,
0);
+ local_state_->SetInteger(prefs::kStabilityExtensionRendererLaunchCount, 0);
local_state_->SetInteger(prefs::kStabilityPageLoadCount, 0);
local_state_->SetInteger(prefs::kStabilityRendererCrashCount, 0);
local_state_->SetInteger(prefs::kStabilityRendererFailedLaunchCount, 0);
local_state_->SetInteger(prefs::kStabilityRendererHangCount, 0);
+ local_state_->SetInteger(prefs::kStabilityRendererLaunchCount, 0);
}
// static
@@ -137,10 +151,13 @@ void StabilityMetricsHelper::RegisterPrefs(PrefRegistrySimple* registry) {
0);
registry->RegisterIntegerPref(
prefs::kStabilityExtensionRendererFailedLaunchCount, 0);
+ registry->RegisterIntegerPref(prefs::kStabilityExtensionRendererLaunchCount,
+ 0);
registry->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0);
registry->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0);
registry->RegisterIntegerPref(prefs::kStabilityRendererFailedLaunchCount, 0);
registry->RegisterIntegerPref(prefs::kStabilityRendererHangCount, 0);
+ registry->RegisterIntegerPref(prefs::kStabilityRendererLaunchCount, 0);
registry->RegisterInt64Pref(prefs::kUninstallMetricsPageLoadCount, 0);
}
@@ -206,6 +223,13 @@ void StabilityMetricsHelper::LogRendererCrash(bool was_extension_process,
}
}
+void StabilityMetricsHelper::LogRendererLaunched(bool was_extension_process) {
+ if (was_extension_process)
+ IncrementPrefValue(prefs::kStabilityExtensionRendererLaunchCount);
+ else
+ IncrementPrefValue(prefs::kStabilityRendererLaunchCount);
+}
+
void StabilityMetricsHelper::IncrementPrefValue(const char* path) {
int value = local_state_->GetInteger(path);
local_state_->SetInteger(path, value + 1);
« no previous file with comments | « components/metrics/stability_metrics_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698