| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/metrics_log.h" | 5 #include "chrome/browser/metrics/metrics_log.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 void MetricsLog::WriteRealtimeStabilityAttributes( | 471 void MetricsLog::WriteRealtimeStabilityAttributes( |
| 472 PrefService* pref, | 472 PrefService* pref, |
| 473 base::TimeDelta incremental_uptime, | 473 base::TimeDelta incremental_uptime, |
| 474 base::TimeDelta uptime) { | 474 base::TimeDelta uptime) { |
| 475 // Update the stats which are critical for real-time stability monitoring. | 475 // Update the stats which are critical for real-time stability monitoring. |
| 476 // Since these are "optional," only list ones that are non-zero, as the counts | 476 // Since these are "optional," only list ones that are non-zero, as the counts |
| 477 // are aggregated (summed) server side. | 477 // are aggregated (summed) server side. |
| 478 | 478 |
| 479 SystemProfileProto::Stability* stability = | 479 SystemProfileProto::Stability* stability = |
| 480 uma_proto()->mutable_system_profile()->mutable_stability(); | 480 uma_proto()->mutable_system_profile()->mutable_stability(); |
| 481 int count = pref->GetInteger(prefs::kStabilityPageLoadCount); | |
| 482 if (count) { | |
| 483 stability->set_page_load_count(count); | |
| 484 pref->SetInteger(prefs::kStabilityPageLoadCount, 0); | |
| 485 } | |
| 486 | 481 |
| 487 count = pref->GetInteger(prefs::kStabilityRendererCrashCount); | 482 int count = pref->GetInteger(prefs::kStabilityChildProcessCrashCount); |
| 488 if (count) { | |
| 489 stability->set_renderer_crash_count(count); | |
| 490 pref->SetInteger(prefs::kStabilityRendererCrashCount, 0); | |
| 491 } | |
| 492 | |
| 493 count = pref->GetInteger(prefs::kStabilityExtensionRendererCrashCount); | |
| 494 if (count) { | |
| 495 stability->set_extension_renderer_crash_count(count); | |
| 496 pref->SetInteger(prefs::kStabilityExtensionRendererCrashCount, 0); | |
| 497 } | |
| 498 | |
| 499 count = pref->GetInteger(prefs::kStabilityRendererHangCount); | |
| 500 if (count) { | |
| 501 stability->set_renderer_hang_count(count); | |
| 502 pref->SetInteger(prefs::kStabilityRendererHangCount, 0); | |
| 503 } | |
| 504 | |
| 505 count = pref->GetInteger(prefs::kStabilityChildProcessCrashCount); | |
| 506 if (count) { | 483 if (count) { |
| 507 stability->set_child_process_crash_count(count); | 484 stability->set_child_process_crash_count(count); |
| 508 pref->SetInteger(prefs::kStabilityChildProcessCrashCount, 0); | 485 pref->SetInteger(prefs::kStabilityChildProcessCrashCount, 0); |
| 509 } | 486 } |
| 510 | 487 |
| 511 #if defined(OS_CHROMEOS) | 488 #if defined(OS_CHROMEOS) |
| 512 metrics_log_chromeos_->WriteRealtimeStabilityAttributes(pref); | 489 metrics_log_chromeos_->WriteRealtimeStabilityAttributes(pref); |
| 513 #endif // OS_CHROMEOS | 490 #endif // OS_CHROMEOS |
| 514 | 491 |
| 515 const uint64 incremental_uptime_sec = incremental_uptime.InSeconds(); | 492 const uint64 incremental_uptime_sec = incremental_uptime.InSeconds(); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 profile = uma_proto()->add_profiler_event(); | 658 profile = uma_proto()->add_profiler_event(); |
| 682 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE); | 659 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE); |
| 683 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME); | 660 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME); |
| 684 } else { | 661 } else { |
| 685 // For the remaining calls, re-use the existing field. | 662 // For the remaining calls, re-use the existing field. |
| 686 profile = uma_proto()->mutable_profiler_event(0); | 663 profile = uma_proto()->mutable_profiler_event(0); |
| 687 } | 664 } |
| 688 | 665 |
| 689 WriteProfilerData(process_data, process_type, profile); | 666 WriteProfilerData(process_data, process_type, profile); |
| 690 } | 667 } |
| OLD | NEW |