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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 #if defined(OS_POSIX) | 234 #if defined(OS_POSIX) |
235 // Returns the maximum number of file descriptors that can be open by a process | 235 // 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. | 236 // at once. If the number is unavailable, a conservative best guess is returned. |
237 size_t GetMaxFds(); | 237 BASE_EXPORT size_t GetMaxFds(); |
238 | 238 |
239 // Sets the file descriptor soft limit to |max_descriptors| or the OS hard | 239 // Sets the file descriptor soft limit to |max_descriptors| or the OS hard |
240 // limit, whichever is lower. | 240 // limit, whichever is lower. |
241 BASE_EXPORT void SetFdLimit(unsigned int max_descriptors); | 241 BASE_EXPORT void SetFdLimit(unsigned int max_descriptors); |
242 #endif // defined(OS_POSIX) | 242 #endif // defined(OS_POSIX) |
243 | 243 |
244 #if defined(OS_LINUX) || defined(OS_ANDROID) | 244 #if defined(OS_LINUX) || defined(OS_ANDROID) |
245 // Parse the data found in /proc/<pid>/stat and return the sum of the | 245 // Parse the data found in /proc/<pid>/stat and return the sum of the |
246 // CPU-related ticks. Returns -1 on parse error. | 246 // CPU-related ticks. Returns -1 on parse error. |
247 // Exposed for testing. | 247 // Exposed for testing. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 SystemDiskInfo disk_info_; | 383 SystemDiskInfo disk_info_; |
384 #endif | 384 #endif |
385 #if defined(OS_CHROMEOS) | 385 #if defined(OS_CHROMEOS) |
386 SwapInfo swap_info_; | 386 SwapInfo swap_info_; |
387 #endif | 387 #endif |
388 }; | 388 }; |
389 | 389 |
390 } // namespace base | 390 } // namespace base |
391 | 391 |
392 #endif // BASE_PROCESS_PROCESS_METRICS_H_ | 392 #endif // BASE_PROCESS_PROCESS_METRICS_H_ |
OLD | NEW |