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

Side by Side Diff: components/arc/metrics/arc_metrics_service.cc

Issue 1828533002: Enable UMA histogram logger for low memor kill events in ArcMetricsService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix NaClBrowserTest Created 4 years, 9 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/arc/metrics/arc_metrics_service.h" 5 #include "components/arc/metrics/arc_metrics_service.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 10
11 namespace { 11 namespace {
12 12
13 const int kRequestProcessListPeriodInMinutes = 5; 13 const int kRequestProcessListPeriodInMinutes = 5;
14 const char kArcProcessNamePrefix[] = "org.chromium.arc."; 14 const char kArcProcessNamePrefix[] = "org.chromium.arc.";
15 const char kGmsProcessNamePrefix[] = "com.google.android.gms"; 15 const char kGmsProcessNamePrefix[] = "com.google.android.gms";
16 16
17 } // namespace 17 } // namespace
18 18
19 namespace arc { 19 namespace arc {
20 20
21 ArcMetricsService::ArcMetricsService(ArcBridgeService* bridge_service) 21 ArcMetricsService::ArcMetricsService(ArcBridgeService* bridge_service)
22 : ArcService(bridge_service), weak_ptr_factory_(this) { 22 : ArcService(bridge_service), weak_ptr_factory_(this) {
23 arc_bridge_service()->AddObserver(this); 23 arc_bridge_service()->AddObserver(this);
24 low_memory_killer_minotor_.Start();
24 } 25 }
25 26
26 ArcMetricsService::~ArcMetricsService() { 27 ArcMetricsService::~ArcMetricsService() {
27 DCHECK(CalledOnValidThread()); 28 DCHECK(CalledOnValidThread());
28 arc_bridge_service()->RemoveObserver(this); 29 arc_bridge_service()->RemoveObserver(this);
29 } 30 }
30 31
31 bool ArcMetricsService::CalledOnValidThread() { 32 bool ArcMetricsService::CalledOnValidThread() {
32 // Make sure access to the Chrome clipboard is happening in the UI thread. 33 // Make sure access to the Chrome clipboard is happening in the UI thread.
33 return thread_checker_.CalledOnValidThread(); 34 return thread_checker_.CalledOnValidThread();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 VLOG(2) << "Skipped " << process_name << " " << process_state; 82 VLOG(2) << "Skipped " << process_name << " " << process_state;
82 } else { 83 } else {
83 ++running_app_count; 84 ++running_app_count;
84 } 85 }
85 } 86 }
86 87
87 UMA_HISTOGRAM_COUNTS_100("Arc.AppCount", running_app_count); 88 UMA_HISTOGRAM_COUNTS_100("Arc.AppCount", running_app_count);
88 } 89 }
89 90
90 } // namespace arc 91 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698