| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 // Computes pss (proportional set size) of a process. Note that this | 147 // Computes pss (proportional set size) of a process. Note that this |
| 148 // function is somewhat expensive on Windows (a few ms per process). | 148 // function is somewhat expensive on Windows (a few ms per process). |
| 149 bool GetProportionalSetSizeBytes(uint64_t* pss_bytes) const; | 149 bool GetProportionalSetSizeBytes(uint64_t* pss_bytes) const; |
| 150 | 150 |
| 151 #if defined(OS_MACOSX) | 151 #if defined(OS_MACOSX) |
| 152 // Fills both CommitedKBytes and WorkingSetKBytes in a single operation. This | 152 // Fills both CommitedKBytes and WorkingSetKBytes in a single operation. This |
| 153 // is more efficient on Mac OS X, as the two can be retrieved with a single | 153 // is more efficient on Mac OS X, as the two can be retrieved with a single |
| 154 // system call. | 154 // system call. |
| 155 bool GetCommittedAndWorkingSetKBytes(CommittedKBytes* usage, | 155 bool GetCommittedAndWorkingSetKBytes(CommittedKBytes* usage, |
| 156 WorkingSetKBytes* ws_usage) const; | 156 WorkingSetKBytes* ws_usage) const; |
| 157 // Returns private, shared, and total resident bytes. | 157 // Returns private, shared, and total resident bytes. |locked_bytes| refers to |
| 158 // bytes that must stay resident. |locked_bytes| only counts bytes locked by |
| 159 // this task, not bytes locked by the kernel. |
| 158 bool GetMemoryBytes(size_t* private_bytes, | 160 bool GetMemoryBytes(size_t* private_bytes, |
| 159 size_t* shared_bytes, | 161 size_t* shared_bytes, |
| 160 size_t* resident_bytes) const; | 162 size_t* resident_bytes, |
| 163 size_t* locked_bytes) const; |
| 161 #endif | 164 #endif |
| 162 | 165 |
| 163 // Returns the CPU usage in percent since the last time this method or | 166 // Returns the CPU usage in percent since the last time this method or |
| 164 // GetPlatformIndependentCPUUsage() was called. The first time this method | 167 // GetPlatformIndependentCPUUsage() was called. The first time this method |
| 165 // is called it returns 0 and will return the actual CPU info on subsequent | 168 // is called it returns 0 and will return the actual CPU info on subsequent |
| 166 // calls. On Windows, the CPU usage value is for all CPUs. So if you have | 169 // calls. On Windows, the CPU usage value is for all CPUs. So if you have |
| 167 // 2 CPUs and your process is using all the cycles of 1 CPU and not the other | 170 // 2 CPUs and your process is using all the cycles of 1 CPU and not the other |
| 168 // CPU, this method returns 50. | 171 // CPU, this method returns 50. |
| 169 double GetCPUUsage(); | 172 double GetCPUUsage(); |
| 170 | 173 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 SystemDiskInfo disk_info_; | 462 SystemDiskInfo disk_info_; |
| 460 #endif | 463 #endif |
| 461 #if defined(OS_CHROMEOS) | 464 #if defined(OS_CHROMEOS) |
| 462 SwapInfo swap_info_; | 465 SwapInfo swap_info_; |
| 463 #endif | 466 #endif |
| 464 }; | 467 }; |
| 465 | 468 |
| 466 } // namespace base | 469 } // namespace base |
| 467 | 470 |
| 468 #endif // BASE_PROCESS_PROCESS_METRICS_H_ | 471 #endif // BASE_PROCESS_PROCESS_METRICS_H_ |
| OLD | NEW |