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

Side by Side Diff: base/process/process_metrics.cc

Issue 29873002: PerformanceMonitor: Add a new UMA histograms to track average CPU utilization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment update Created 7 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/process/process_metrics.h" 5 #include "base/process/process_metrics.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 8
9 namespace base { 9 namespace base {
10 10
(...skipping 24 matching lines...) Expand all
35 res->Set("meminfo", memory_info_.ToValue().release()); 35 res->Set("meminfo", memory_info_.ToValue().release());
36 res->Set("diskinfo", disk_info_.ToValue().release()); 36 res->Set("diskinfo", disk_info_.ToValue().release());
37 #endif 37 #endif
38 #if defined(OS_CHROMEOS) 38 #if defined(OS_CHROMEOS)
39 res->Set("swapinfo", swap_info_.ToValue().release()); 39 res->Set("swapinfo", swap_info_.ToValue().release());
40 #endif 40 #endif
41 41
42 return res.PassAs<Value>(); 42 return res.PassAs<Value>();
43 } 43 }
44 44
45 double ProcessMetrics::GetPlatformIndependentCPUUsage() {
46 #if defined(OS_WIN)
47 return GetCPUUsage() * processor_count_;
48 #else
49 return GetCPUUsage();
50 #endif
51 }
52
45 } // namespace base 53 } // namespace base
OLDNEW
« no previous file with comments | « base/process/process_metrics.h ('k') | chrome/browser/performance_monitor/process_metrics_history.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698