| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // pagefile.sys) | 78 // pagefile.sys) |
| 79 // image: These pages are mapped into the view of an image section (backed by | 79 // image: These pages are mapped into the view of an image section (backed by |
| 80 // file system) | 80 // file system) |
| 81 struct CommittedKBytes { | 81 struct CommittedKBytes { |
| 82 CommittedKBytes() : priv(0), mapped(0), image(0) {} | 82 CommittedKBytes() : priv(0), mapped(0), image(0) {} |
| 83 size_t priv; | 83 size_t priv; |
| 84 size_t mapped; | 84 size_t mapped; |
| 85 size_t image; | 85 size_t image; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 // Free memory (Megabytes marked as free) in the 2G process address space. | |
| 89 // total : total amount in megabytes marked as free. Maximum value is 2048. | |
| 90 // largest : size of the largest contiguous amount of memory found. It is | |
| 91 // always smaller or equal to FreeMBytes::total. | |
| 92 // largest_ptr: starting address of the largest memory block. | |
| 93 struct FreeMBytes { | |
| 94 size_t total; | |
| 95 size_t largest; | |
| 96 void* largest_ptr; | |
| 97 }; | |
| 98 | |
| 99 // Convert a POSIX timeval to microseconds. | 88 // Convert a POSIX timeval to microseconds. |
| 100 BASE_EXPORT int64 TimeValToMicroseconds(const struct timeval& tv); | 89 BASE_EXPORT int64 TimeValToMicroseconds(const struct timeval& tv); |
| 101 | 90 |
| 102 // Provides performance metrics for a specified process (CPU usage, memory and | 91 // Provides performance metrics for a specified process (CPU usage, memory and |
| 103 // IO counters). To use it, invoke CreateProcessMetrics() to get an instance | 92 // IO counters). To use it, invoke CreateProcessMetrics() to get an instance |
| 104 // for a specific process, then access the information with the different get | 93 // for a specific process, then access the information with the different get |
| 105 // methods. | 94 // methods. |
| 106 class BASE_EXPORT ProcessMetrics { | 95 class BASE_EXPORT ProcessMetrics { |
| 107 public: | 96 public: |
| 108 ~ProcessMetrics(); | 97 ~ProcessMetrics(); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 SystemDiskInfo disk_info_; | 375 SystemDiskInfo disk_info_; |
| 387 #endif | 376 #endif |
| 388 #if defined(OS_CHROMEOS) | 377 #if defined(OS_CHROMEOS) |
| 389 SwapInfo swap_info_; | 378 SwapInfo swap_info_; |
| 390 #endif | 379 #endif |
| 391 }; | 380 }; |
| 392 | 381 |
| 393 } // namespace base | 382 } // namespace base |
| 394 | 383 |
| 395 #endif // BASE_PROCESS_PROCESS_METRICS_H_ | 384 #endif // BASE_PROCESS_PROCESS_METRICS_H_ |
| OLD | NEW |