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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 #endif // defined(OS_POSIX) | 224 #endif // defined(OS_POSIX) |
225 #endif // !defined(OS_IOS) | 225 #endif // !defined(OS_IOS) |
226 | 226 |
227 DISALLOW_COPY_AND_ASSIGN(ProcessMetrics); | 227 DISALLOW_COPY_AND_ASSIGN(ProcessMetrics); |
228 }; | 228 }; |
229 | 229 |
230 // Returns the memory committed by the system in KBytes. | 230 // Returns the memory committed by the system in KBytes. |
231 // Returns 0 if it can't compute the commit charge. | 231 // Returns 0 if it can't compute the commit charge. |
232 BASE_EXPORT size_t GetSystemCommitCharge(); | 232 BASE_EXPORT size_t GetSystemCommitCharge(); |
233 | 233 |
| 234 // Returns the number of bytes in a memory page. |
| 235 BASE_EXPORT size_t GetPageSize(); |
| 236 |
234 #if defined(OS_POSIX) | 237 #if defined(OS_POSIX) |
235 // Returns the maximum number of file descriptors that can be open by a process | 238 // Returns the maximum number of file descriptors that can be open by a process |
236 // at once. If the number is unavailable, a conservative best guess is returned. | 239 // at once. If the number is unavailable, a conservative best guess is returned. |
237 BASE_EXPORT size_t GetMaxFds(); | 240 BASE_EXPORT size_t GetMaxFds(); |
238 | 241 |
239 // Sets the file descriptor soft limit to |max_descriptors| or the OS hard | 242 // Sets the file descriptor soft limit to |max_descriptors| or the OS hard |
240 // limit, whichever is lower. | 243 // limit, whichever is lower. |
241 BASE_EXPORT void SetFdLimit(unsigned int max_descriptors); | 244 BASE_EXPORT void SetFdLimit(unsigned int max_descriptors); |
242 #endif // defined(OS_POSIX) | 245 #endif // defined(OS_POSIX) |
243 | 246 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 SystemDiskInfo disk_info_; | 386 SystemDiskInfo disk_info_; |
384 #endif | 387 #endif |
385 #if defined(OS_CHROMEOS) | 388 #if defined(OS_CHROMEOS) |
386 SwapInfo swap_info_; | 389 SwapInfo swap_info_; |
387 #endif | 390 #endif |
388 }; | 391 }; |
389 | 392 |
390 } // namespace base | 393 } // namespace base |
391 | 394 |
392 #endif // BASE_PROCESS_PROCESS_METRICS_H_ | 395 #endif // BASE_PROCESS_PROCESS_METRICS_H_ |
OLD | NEW |