OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // This file contains routines for gathering resource statistics for processes | 5 // This file contains routines for gathering resource statistics for processes |
6 // running on the system. | 6 // running on the system. |
7 | 7 |
8 #ifndef BASE_PROCESS_PROCESS_METRICS_H_ | 8 #ifndef BASE_PROCESS_PROCESS_METRICS_H_ |
9 #define BASE_PROCESS_PROCESS_METRICS_H_ | 9 #define BASE_PROCESS_PROCESS_METRICS_H_ |
10 | 10 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 #endif // !defined(OS_MACOSX) || defined(OS_IOS) | 186 #endif // !defined(OS_MACOSX) || defined(OS_IOS) |
187 | 187 |
188 #if defined(OS_LINUX) || defined(OS_ANDROID) | 188 #if defined(OS_LINUX) || defined(OS_ANDROID) |
189 bool GetWorkingSetKBytesStatm(WorkingSetKBytes* ws_usage) const; | 189 bool GetWorkingSetKBytesStatm(WorkingSetKBytes* ws_usage) const; |
190 #endif | 190 #endif |
191 | 191 |
192 #if defined(OS_CHROMEOS) | 192 #if defined(OS_CHROMEOS) |
193 bool GetWorkingSetKBytesTotmaps(WorkingSetKBytes *ws_usage) const; | 193 bool GetWorkingSetKBytesTotmaps(WorkingSetKBytes *ws_usage) const; |
194 #endif | 194 #endif |
195 | 195 |
| 196 #if defined(OS_MACOSX) || defined(OS_LINUX) |
| 197 int CalculateIdleWakeupsPerSecond(uint64 absolute_idle_wakeups); |
| 198 #endif |
| 199 |
196 ProcessHandle process_; | 200 ProcessHandle process_; |
197 | 201 |
198 int processor_count_; | 202 int processor_count_; |
199 | 203 |
200 // Used to store the previous times and CPU usage counts so we can | 204 // Used to store the previous times and CPU usage counts so we can |
201 // compute the CPU usage between calls. | 205 // compute the CPU usage between calls. |
202 TimeTicks last_cpu_time_; | 206 TimeTicks last_cpu_time_; |
203 int64 last_system_time_; | 207 int64 last_system_time_; |
204 | 208 |
205 #if defined(OS_MACOSX) | 209 #if defined(OS_MACOSX) || defined(OS_LINUX) |
206 // Same thing for idle wakeups. | 210 // Same thing for idle wakeups. |
207 TimeTicks last_idle_wakeups_time_; | 211 TimeTicks last_idle_wakeups_time_; |
208 uint64 last_absolute_idle_wakeups_; | 212 uint64 last_absolute_idle_wakeups_; |
209 #endif | 213 #endif |
210 | 214 |
211 #if !defined(OS_IOS) | 215 #if !defined(OS_IOS) |
212 #if defined(OS_MACOSX) | 216 #if defined(OS_MACOSX) |
213 // Queries the port provider if it's set. | 217 // Queries the port provider if it's set. |
214 mach_port_t TaskForPid(ProcessHandle process) const; | 218 mach_port_t TaskForPid(ProcessHandle process) const; |
215 | 219 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 SystemDiskInfo disk_info_; | 383 SystemDiskInfo disk_info_; |
380 #endif | 384 #endif |
381 #if defined(OS_CHROMEOS) | 385 #if defined(OS_CHROMEOS) |
382 SwapInfo swap_info_; | 386 SwapInfo swap_info_; |
383 #endif | 387 #endif |
384 }; | 388 }; |
385 | 389 |
386 } // namespace base | 390 } // namespace base |
387 | 391 |
388 #endif // BASE_PROCESS_PROCESS_METRICS_H_ | 392 #endif // BASE_PROCESS_PROCESS_METRICS_H_ |
OLD | NEW |