OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/stability_metrics_helper.h" | 5 #include "components/metrics/stability_metrics_helper.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 RecordMemoryStats(was_extension_process | 190 RecordMemoryStats(was_extension_process |
191 ? RECORD_MEMORY_STATS_EXTENSIONS_OOM_KILLED | 191 ? RECORD_MEMORY_STATS_EXTENSIONS_OOM_KILLED |
192 : RECORD_MEMORY_STATS_CONTENTS_OOM_KILLED); | 192 : RECORD_MEMORY_STATS_CONTENTS_OOM_KILLED); |
193 #endif | 193 #endif |
194 } else if (status == base::TERMINATION_STATUS_STILL_RUNNING) { | 194 } else if (status == base::TERMINATION_STATUS_STILL_RUNNING) { |
195 UMA_HISTOGRAM_ENUMERATION("BrowserRenderProcessHost.DisconnectedAlive", | 195 UMA_HISTOGRAM_ENUMERATION("BrowserRenderProcessHost.DisconnectedAlive", |
196 histogram_type, RENDERER_TYPE_COUNT); | 196 histogram_type, RENDERER_TYPE_COUNT); |
197 } else if (status == base::TERMINATION_STATUS_LAUNCH_FAILED) { | 197 } else if (status == base::TERMINATION_STATUS_LAUNCH_FAILED) { |
198 UMA_HISTOGRAM_ENUMERATION("BrowserRenderProcessHost.ChildLaunchFailures", | 198 UMA_HISTOGRAM_ENUMERATION("BrowserRenderProcessHost.ChildLaunchFailures", |
199 histogram_type, RENDERER_TYPE_COUNT); | 199 histogram_type, RENDERER_TYPE_COUNT); |
| 200 UMA_HISTOGRAM_SPARSE_SLOWLY( |
| 201 "BrowserRenderProcessHost.ChildLaunchFailureCodes", exit_code); |
200 if (was_extension_process) | 202 if (was_extension_process) |
201 IncrementPrefValue(prefs::kStabilityExtensionRendererFailedLaunchCount); | 203 IncrementPrefValue(prefs::kStabilityExtensionRendererFailedLaunchCount); |
202 else | 204 else |
203 IncrementPrefValue(prefs::kStabilityRendererFailedLaunchCount); | 205 IncrementPrefValue(prefs::kStabilityRendererFailedLaunchCount); |
204 } | 206 } |
205 } | 207 } |
206 | 208 |
207 void StabilityMetricsHelper::IncrementPrefValue(const char* path) { | 209 void StabilityMetricsHelper::IncrementPrefValue(const char* path) { |
208 int value = local_state_->GetInteger(path); | 210 int value = local_state_->GetInteger(path); |
209 local_state_->SetInteger(path, value + 1); | 211 local_state_->SetInteger(path, value + 1); |
210 } | 212 } |
211 | 213 |
212 void StabilityMetricsHelper::IncrementLongPrefsValue(const char* path) { | 214 void StabilityMetricsHelper::IncrementLongPrefsValue(const char* path) { |
213 int64_t value = local_state_->GetInt64(path); | 215 int64_t value = local_state_->GetInt64(path); |
214 local_state_->SetInt64(path, value + 1); | 216 local_state_->SetInt64(path, value + 1); |
215 } | 217 } |
216 | 218 |
217 void StabilityMetricsHelper::LogRendererHang() { | 219 void StabilityMetricsHelper::LogRendererHang() { |
218 IncrementPrefValue(prefs::kStabilityRendererHangCount); | 220 IncrementPrefValue(prefs::kStabilityRendererHangCount); |
219 } | 221 } |
220 | 222 |
221 } // namespace metrics | 223 } // namespace metrics |
OLD | NEW |