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 19 matching lines...) Expand all Loading... |
30 #include "chrome/browser/metrics/plugin_metrics_provider.h" | 30 #include "chrome/browser/metrics/plugin_metrics_provider.h" |
31 #endif | 31 #endif |
32 | 32 |
33 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
34 #include <windows.h> // Needed for STATUS_* codes | 34 #include <windows.h> // Needed for STATUS_* codes |
35 #include "chrome/installer/util/install_util.h" | 35 #include "chrome/installer/util/install_util.h" |
36 #include "components/browser_watcher/crash_reporting_metrics_win.h" | 36 #include "components/browser_watcher/crash_reporting_metrics_win.h" |
37 #endif | 37 #endif |
38 | 38 |
39 #if defined(OS_CHROMEOS) | 39 #if defined(OS_CHROMEOS) |
40 #include "chrome/browser/chromeos/memory/system_memory_stats_recorder.h" | 40 #include "chrome/browser/memory/system_memory_stats_recorder.h" |
41 #endif | 41 #endif |
42 | 42 |
43 namespace { | 43 namespace { |
44 | 44 |
45 void IncrementPrefValue(const char* path) { | 45 void IncrementPrefValue(const char* path) { |
46 PrefService* pref = g_browser_process->local_state(); | 46 PrefService* pref = g_browser_process->local_state(); |
47 DCHECK(pref); | 47 DCHECK(pref); |
48 int value = pref->GetInteger(path); | 48 int value = pref->GetInteger(path); |
49 pref->SetInteger(path, value + 1); | 49 pref->SetInteger(path, value + 1); |
50 } | 50 } |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.ChildCrashes", | 295 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.ChildCrashes", |
296 was_extension_process ? 2 : 1); | 296 was_extension_process ? 2 : 1); |
297 } else if (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { | 297 } else if (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { |
298 RecordChildKills(was_extension_process); | 298 RecordChildKills(was_extension_process); |
299 #if defined(OS_CHROMEOS) | 299 #if defined(OS_CHROMEOS) |
300 } else if (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM) { | 300 } else if (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM) { |
301 RecordChildKills(was_extension_process); | 301 RecordChildKills(was_extension_process); |
302 UMA_HISTOGRAM_ENUMERATION("BrowserRenderProcessHost.ChildKills.OOM", | 302 UMA_HISTOGRAM_ENUMERATION("BrowserRenderProcessHost.ChildKills.OOM", |
303 was_extension_process ? 2 : 1, | 303 was_extension_process ? 2 : 1, |
304 3); | 304 3); |
305 chromeos::RecordMemoryStats( | 305 memory::RecordMemoryStats( |
306 was_extension_process ? | 306 was_extension_process |
307 chromeos::RECORD_MEMORY_STATS_EXTENSIONS_OOM_KILLED : | 307 ? memory::RECORD_MEMORY_STATS_EXTENSIONS_OOM_KILLED |
308 chromeos::RECORD_MEMORY_STATS_CONTENTS_OOM_KILLED); | 308 : memory::RECORD_MEMORY_STATS_CONTENTS_OOM_KILLED); |
309 #endif | 309 #endif |
310 } else if (status == base::TERMINATION_STATUS_STILL_RUNNING) { | 310 } else if (status == base::TERMINATION_STATUS_STILL_RUNNING) { |
311 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.DisconnectedAlive", | 311 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.DisconnectedAlive", |
312 was_extension_process ? 2 : 1); | 312 was_extension_process ? 2 : 1); |
313 } | 313 } |
314 } | 314 } |
315 | 315 |
316 void ChromeStabilityMetricsProvider::LogRendererHang() { | 316 void ChromeStabilityMetricsProvider::LogRendererHang() { |
317 IncrementPrefValue(prefs::kStabilityRendererHangCount); | 317 IncrementPrefValue(prefs::kStabilityRendererHangCount); |
318 } | 318 } |
OLD | NEW |