OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PERFORMANCE_MONITOR_H_ | 5 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ |
6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ | 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 14 matching lines...) Expand all Loading... |
25 class PerformanceMonitor { | 25 class PerformanceMonitor { |
26 public: | 26 public: |
27 // Returns the current PerformanceMonitor instance if one exists; otherwise | 27 // Returns the current PerformanceMonitor instance if one exists; otherwise |
28 // constructs a new PerformanceMonitor. | 28 // constructs a new PerformanceMonitor. |
29 static PerformanceMonitor* GetInstance(); | 29 static PerformanceMonitor* GetInstance(); |
30 | 30 |
31 // Start the cycle of metrics gathering. | 31 // Start the cycle of metrics gathering. |
32 void StartGatherCycle(); | 32 void StartGatherCycle(); |
33 | 33 |
34 private: | 34 private: |
35 friend struct base::DefaultLazyInstanceTraits<PerformanceMonitor>; | 35 friend struct base::LazyInstanceTraitsBase<PerformanceMonitor>; |
36 | 36 |
37 using MetricsMap = | 37 using MetricsMap = |
38 std::map<base::ProcessHandle, std::unique_ptr<ProcessMetricsHistory>>; | 38 std::map<base::ProcessHandle, std::unique_ptr<ProcessMetricsHistory>>; |
39 | 39 |
40 PerformanceMonitor(); | 40 PerformanceMonitor(); |
41 ~PerformanceMonitor(); | 41 ~PerformanceMonitor(); |
42 | 42 |
43 // Perform any collections that are done on a timed basis. | 43 // Perform any collections that are done on a timed basis. |
44 void DoTimedCollections(); | 44 void DoTimedCollections(); |
45 | 45 |
(...skipping 19 matching lines...) Expand all Loading... |
65 | 65 |
66 // The timer to signal PerformanceMonitor to perform its timed collections. | 66 // The timer to signal PerformanceMonitor to perform its timed collections. |
67 base::OneShotTimer repeating_timer_; | 67 base::OneShotTimer repeating_timer_; |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(PerformanceMonitor); | 69 DISALLOW_COPY_AND_ASSIGN(PerformanceMonitor); |
70 }; | 70 }; |
71 | 71 |
72 } // namespace performance_monitor | 72 } // namespace performance_monitor |
73 | 73 |
74 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ | 74 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ |
OLD | NEW |