| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_PROCESS_METRICS_HISTORY_H_ | 5 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_PROCESS_METRICS_HISTORY_H_ |
| 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_PROCESS_METRICS_HISTORY_H_ | 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_PROCESS_METRICS_HISTORY_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/linked_ptr.h" | 9 #include "base/memory/linked_ptr.h" |
| 10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 ProcessMetricsMetadata() | 32 ProcessMetricsMetadata() |
| 33 : handle(base::kNullProcessHandle), | 33 : handle(base::kNullProcessHandle), |
| 34 process_type(content::PROCESS_TYPE_UNKNOWN), | 34 process_type(content::PROCESS_TYPE_UNKNOWN), |
| 35 process_subtype(kProcessSubtypeUnknown) {} | 35 process_subtype(kProcessSubtypeUnknown) {} |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 class ProcessMetricsHistory { | 38 class ProcessMetricsHistory { |
| 39 public: | 39 public: |
| 40 ProcessMetricsHistory(); | 40 ProcessMetricsHistory(); |
| 41 ProcessMetricsHistory(const ProcessMetricsHistory& other); |
| 41 ~ProcessMetricsHistory(); | 42 ~ProcessMetricsHistory(); |
| 42 | 43 |
| 43 // Configure this to monitor a specific process. | 44 // Configure this to monitor a specific process. |
| 44 void Initialize(const ProcessMetricsMetadata& process_data, | 45 void Initialize(const ProcessMetricsMetadata& process_data, |
| 45 int initial_update_sequence); | 46 int initial_update_sequence); |
| 46 | 47 |
| 47 // Gather metrics for the process and accumulate with past data. | 48 // Gather metrics for the process and accumulate with past data. |
| 48 void SampleMetrics(); | 49 void SampleMetrics(); |
| 49 | 50 |
| 50 // Triggers any UMA histograms or background traces if cpu_usage is excessive. | 51 // Triggers any UMA histograms or background traces if cpu_usage is excessive. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 68 double cpu_usage_; | 69 double cpu_usage_; |
| 69 | 70 |
| 70 content::BackgroundTracingManager::TriggerHandle trace_trigger_handle_; | 71 content::BackgroundTracingManager::TriggerHandle trace_trigger_handle_; |
| 71 | 72 |
| 72 DISALLOW_ASSIGN(ProcessMetricsHistory); | 73 DISALLOW_ASSIGN(ProcessMetricsHistory); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace performance_monitor | 76 } // namespace performance_monitor |
| 76 | 77 |
| 77 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_PROCESS_METRICS_HISTORY_H_ | 78 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_PROCESS_METRICS_HISTORY_H_ |
| OLD | NEW |