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

Side by Side Diff: chrome/browser/metrics/metrics_log.cc

Issue 289283011: Introduce ChromeStabilityMetricsProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 stability->set_crash_count(crash_count); 536 stability->set_crash_count(crash_count);
537 } 537 }
538 538
539 void MetricsLog::WriteRealtimeStabilityAttributes( 539 void MetricsLog::WriteRealtimeStabilityAttributes(
540 PrefService* pref, 540 PrefService* pref,
541 base::TimeDelta incremental_uptime, 541 base::TimeDelta incremental_uptime,
542 base::TimeDelta uptime) { 542 base::TimeDelta uptime) {
543 // Update the stats which are critical for real-time stability monitoring. 543 // Update the stats which are critical for real-time stability monitoring.
544 // Since these are "optional," only list ones that are non-zero, as the counts 544 // Since these are "optional," only list ones that are non-zero, as the counts
545 // are aggregated (summed) server side. 545 // are aggregated (summed) server side.
546
547 SystemProfileProto::Stability* stability = 546 SystemProfileProto::Stability* stability =
548 uma_proto()->mutable_system_profile()->mutable_stability(); 547 uma_proto()->mutable_system_profile()->mutable_stability();
549 int count = pref->GetInteger(prefs::kStabilityPageLoadCount);
550 if (count) {
551 stability->set_page_load_count(count);
552 pref->SetInteger(prefs::kStabilityPageLoadCount, 0);
553 }
554 548
555 count = pref->GetInteger(prefs::kStabilityRendererCrashCount); 549 int count = pref->GetInteger(prefs::kStabilityChildProcessCrashCount);
556 if (count) {
557 stability->set_renderer_crash_count(count);
558 pref->SetInteger(prefs::kStabilityRendererCrashCount, 0);
559 }
560
561 count = pref->GetInteger(prefs::kStabilityExtensionRendererCrashCount);
562 if (count) {
563 stability->set_extension_renderer_crash_count(count);
564 pref->SetInteger(prefs::kStabilityExtensionRendererCrashCount, 0);
565 }
566
567 count = pref->GetInteger(prefs::kStabilityRendererHangCount);
568 if (count) {
569 stability->set_renderer_hang_count(count);
570 pref->SetInteger(prefs::kStabilityRendererHangCount, 0);
571 }
572
573 count = pref->GetInteger(prefs::kStabilityChildProcessCrashCount);
574 if (count) { 550 if (count) {
575 stability->set_child_process_crash_count(count); 551 stability->set_child_process_crash_count(count);
576 pref->SetInteger(prefs::kStabilityChildProcessCrashCount, 0); 552 pref->SetInteger(prefs::kStabilityChildProcessCrashCount, 0);
577 } 553 }
578 554
579 #if defined(OS_CHROMEOS) 555 #if defined(OS_CHROMEOS)
580 metrics_log_chromeos_->WriteRealtimeStabilityAttributes(pref); 556 metrics_log_chromeos_->WriteRealtimeStabilityAttributes(pref);
581 #endif // OS_CHROMEOS 557 #endif // OS_CHROMEOS
582 558
583 const uint64 incremental_uptime_sec = incremental_uptime.InSeconds(); 559 const uint64 incremental_uptime_sec = incremental_uptime.InSeconds();
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 ProductDataToProto(google_update_metrics.google_update_data, 769 ProductDataToProto(google_update_metrics.google_update_data,
794 google_update->mutable_google_update_status()); 770 google_update->mutable_google_update_status());
795 } 771 }
796 772
797 if (!google_update_metrics.product_data.version.empty()) { 773 if (!google_update_metrics.product_data.version.empty()) {
798 ProductDataToProto(google_update_metrics.product_data, 774 ProductDataToProto(google_update_metrics.product_data,
799 google_update->mutable_client_status()); 775 google_update->mutable_client_status());
800 } 776 }
801 #endif // defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) 777 #endif // defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN)
802 } 778 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698