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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // Returns private and sharedusage, in bytes. Private bytes is the amount of | 133 // Returns private and sharedusage, in bytes. Private bytes is the amount of |
134 // memory currently allocated to a process that cannot be shared. Returns | 134 // memory currently allocated to a process that cannot be shared. Returns |
135 // false on platform specific error conditions. Note: |private_bytes| | 135 // false on platform specific error conditions. Note: |private_bytes| |
136 // returns 0 on unsupported OSes: prior to XP SP2. | 136 // returns 0 on unsupported OSes: prior to XP SP2. |
137 bool GetMemoryBytes(size_t* private_bytes, | 137 bool GetMemoryBytes(size_t* private_bytes, |
138 size_t* shared_bytes); | 138 size_t* shared_bytes); |
139 // Fills a CommittedKBytes with both resident and paged | 139 // Fills a CommittedKBytes with both resident and paged |
140 // memory usage as per definition of CommittedBytes. | 140 // memory usage as per definition of CommittedBytes. |
141 void GetCommittedKBytes(CommittedKBytes* usage) const; | 141 void GetCommittedKBytes(CommittedKBytes* usage) const; |
142 // Fills a WorkingSetKBytes containing resident private and shared memory | 142 // Fills a WorkingSetKBytes containing resident private and shared memory |
143 // usage in bytes, as per definition of WorkingSetBytes. | 143 // usage in bytes, as per definition of WorkingSetBytes. Note that this |
| 144 // function is somewhat expensive on Windows (a few ms per process). |
144 bool GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const; | 145 bool GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const; |
145 | 146 |
146 #if defined(OS_MACOSX) | 147 #if defined(OS_MACOSX) |
147 // Fills both CommitedKBytes and WorkingSetKBytes in a single operation. This | 148 // Fills both CommitedKBytes and WorkingSetKBytes in a single operation. This |
148 // is more efficient on Mac OS X, as the two can be retrieved with a single | 149 // is more efficient on Mac OS X, as the two can be retrieved with a single |
149 // system call. | 150 // system call. |
150 bool GetCommittedAndWorkingSetKBytes(CommittedKBytes* usage, | 151 bool GetCommittedAndWorkingSetKBytes(CommittedKBytes* usage, |
151 WorkingSetKBytes* ws_usage) const; | 152 WorkingSetKBytes* ws_usage) const; |
152 #endif | 153 #endif |
153 | 154 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 SystemDiskInfo disk_info_; | 384 SystemDiskInfo disk_info_; |
384 #endif | 385 #endif |
385 #if defined(OS_CHROMEOS) | 386 #if defined(OS_CHROMEOS) |
386 SwapInfo swap_info_; | 387 SwapInfo swap_info_; |
387 #endif | 388 #endif |
388 }; | 389 }; |
389 | 390 |
390 } // namespace base | 391 } // namespace base |
391 | 392 |
392 #endif // BASE_PROCESS_PROCESS_METRICS_H_ | 393 #endif // BASE_PROCESS_PROCESS_METRICS_H_ |
OLD | NEW |