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

Side by Side Diff: chrome/browser/task_manager/task_manager.cc

Issue 546193002: Add an 'Idle Wake Ups' metric to the Linux task manager, implement backend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wakeclean
Patch Set: rebase Created 6 years, 3 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
« no previous file with comments | « base/process/process_metrics_mac.cc ('k') | chrome/browser/ui/views/task_manager_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/task_manager/task_manager.h" 5 #include "chrome/browser/task_manager/task_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/i18n/number_formatting.h" 8 #include "base/i18n/number_formatting.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 } 1149 }
1150 #endif // !defined(DISABLE_NACL) 1150 #endif // !defined(DISABLE_NACL)
1151 if (values.is_cpu_usage_valid && values.is_idle_wakeups_valid) 1151 if (values.is_cpu_usage_valid && values.is_idle_wakeups_valid)
1152 continue; 1152 continue;
1153 MetricsMap::iterator metrics_iter = metrics_map_.find(process); 1153 MetricsMap::iterator metrics_iter = metrics_map_.find(process);
1154 DCHECK(metrics_iter != metrics_map_.end()); 1154 DCHECK(metrics_iter != metrics_map_.end());
1155 if (!values.is_cpu_usage_valid) { 1155 if (!values.is_cpu_usage_valid) {
1156 values.is_cpu_usage_valid = true; 1156 values.is_cpu_usage_valid = true;
1157 values.cpu_usage = metrics_iter->second->GetCPUUsage(); 1157 values.cpu_usage = metrics_iter->second->GetCPUUsage();
1158 } 1158 }
1159 #if defined(OS_MACOSX) 1159 #if defined(OS_MACOSX) || defined(OS_LINUX)
1160 // TODO: Implement GetIdleWakeupsPerSecond() on other platforms, 1160 // TODO(port): Implement GetIdleWakeupsPerSecond() on other platforms,
1161 // crbug.com/120488 1161 // crbug.com/120488
1162 if (!values.is_idle_wakeups_valid) { 1162 if (!values.is_idle_wakeups_valid) {
1163 values.is_idle_wakeups_valid = true; 1163 values.is_idle_wakeups_valid = true;
1164 values.idle_wakeups = metrics_iter->second->GetIdleWakeupsPerSecond(); 1164 values.idle_wakeups = metrics_iter->second->GetIdleWakeupsPerSecond();
1165 } 1165 }
1166 #endif // defined(OS_MACOSX) 1166 #endif // defined(OS_MACOSX) || defined(OS_LINUX)
1167 } 1167 }
1168 1168
1169 // Send a request to refresh GPU memory consumption values 1169 // Send a request to refresh GPU memory consumption values
1170 RefreshVideoMemoryUsageStats(); 1170 RefreshVideoMemoryUsageStats();
1171 1171
1172 // Compute the new network usage values. 1172 // Compute the new network usage values.
1173 base::TimeDelta update_time = 1173 base::TimeDelta update_time =
1174 base::TimeDelta::FromMilliseconds(kUpdateTimeMs); 1174 base::TimeDelta::FromMilliseconds(kUpdateTimeMs);
1175 for (ResourceValueMap::iterator iter = current_byte_count_map_.begin(); 1175 for (ResourceValueMap::iterator iter = current_byte_count_map_.begin();
1176 iter != current_byte_count_map_.end(); ++iter) { 1176 iter != current_byte_count_map_.end(); ++iter) {
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 params.host_desktop_type = desktop_type; 1535 params.host_desktop_type = desktop_type;
1536 chrome::Navigate(&params); 1536 chrome::Navigate(&params);
1537 } 1537 }
1538 1538
1539 TaskManager::TaskManager() 1539 TaskManager::TaskManager()
1540 : model_(new TaskManagerModel(this)) { 1540 : model_(new TaskManagerModel(this)) {
1541 } 1541 }
1542 1542
1543 TaskManager::~TaskManager() { 1543 TaskManager::~TaskManager() {
1544 } 1544 }
OLDNEW
« no previous file with comments | « base/process/process_metrics_mac.cc ('k') | chrome/browser/ui/views/task_manager_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698