| 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 "chrome/browser/metrics/chrome_stability_metrics_provider.h" | 5 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 if (PluginMetricsProvider::IsPluginProcess(data.process_type)) | 180 if (PluginMetricsProvider::IsPluginProcess(data.process_type)) |
| 181 return; | 181 return; |
| 182 #endif | 182 #endif |
| 183 | 183 |
| 184 IncrementPrefValue(prefs::kStabilityChildProcessCrashCount); | 184 IncrementPrefValue(prefs::kStabilityChildProcessCrashCount); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void ChromeStabilityMetricsProvider::LogLoadStarted( | 187 void ChromeStabilityMetricsProvider::LogLoadStarted( |
| 188 content::WebContents* web_contents) { | 188 content::WebContents* web_contents) { |
| 189 content::RecordAction(base::UserMetricsAction("PageLoad")); | 189 content::RecordAction(base::UserMetricsAction("PageLoad")); |
| 190 HISTOGRAM_ENUMERATION("Chrome.UmaPageloadCounter", 1, 2); | 190 // TODO(asvitkine): Check if this is used for anything and if not, remove. |
| 191 LOCAL_HISTOGRAM_BOOLEAN("Chrome.UmaPageloadCounter", true); |
| 191 IncrementPrefValue(prefs::kStabilityPageLoadCount); | 192 IncrementPrefValue(prefs::kStabilityPageLoadCount); |
| 192 IncrementLongPrefsValue(prefs::kUninstallMetricsPageLoadCount); | 193 IncrementLongPrefsValue(prefs::kUninstallMetricsPageLoadCount); |
| 193 // We need to save the prefs, as page load count is a critical stat, and it | 194 // We need to save the prefs, as page load count is a critical stat, and it |
| 194 // might be lost due to a crash :-(. | 195 // might be lost due to a crash :-(. |
| 195 } | 196 } |
| 196 | 197 |
| 197 void ChromeStabilityMetricsProvider::LogRendererCrash( | 198 void ChromeStabilityMetricsProvider::LogRendererCrash( |
| 198 content::RenderProcessHost* host, | 199 content::RenderProcessHost* host, |
| 199 base::TerminationStatus status, | 200 base::TerminationStatus status, |
| 200 int exit_code) { | 201 int exit_code) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 225 was_extension_process ? 2 : 1); | 226 was_extension_process ? 2 : 1); |
| 226 } else if (status == base::TERMINATION_STATUS_STILL_RUNNING) { | 227 } else if (status == base::TERMINATION_STATUS_STILL_RUNNING) { |
| 227 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.DisconnectedAlive", | 228 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.DisconnectedAlive", |
| 228 was_extension_process ? 2 : 1); | 229 was_extension_process ? 2 : 1); |
| 229 } | 230 } |
| 230 } | 231 } |
| 231 | 232 |
| 232 void ChromeStabilityMetricsProvider::LogRendererHang() { | 233 void ChromeStabilityMetricsProvider::LogRendererHang() { |
| 233 IncrementPrefValue(prefs::kStabilityRendererHangCount); | 234 IncrementPrefValue(prefs::kStabilityRendererHangCount); |
| 234 } | 235 } |
| OLD | NEW |