OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 REMOTING_PROTOCOL_PERFORMANCE_TRACKER_H_ | 5 #ifndef REMOTING_PROTOCOL_PERFORMANCE_TRACKER_H_ |
6 #define REMOTING_PROTOCOL_PERFORMANCE_TRACKER_H_ | 6 #define REMOTING_PROTOCOL_PERFORMANCE_TRACKER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
10 #include "remoting/base/rate_counter.h" | 10 #include "remoting/base/rate_counter.h" |
11 #include "remoting/base/running_average.h" | 11 #include "remoting/base/running_average.h" |
12 | 12 |
13 namespace remoting { | 13 namespace remoting { |
14 | 14 |
15 class VideoPacket; | 15 class VideoPacket; |
16 | 16 |
17 namespace protocol { | 17 namespace protocol { |
18 | 18 |
19 // PerformanceTracker defines a bundle of performance counters and statistics | 19 // PerformanceTracker defines a bundle of performance counters and statistics |
20 // for chromoting. | 20 // for chromoting. |
21 class PerformanceTracker { | 21 class PerformanceTracker { |
22 public: | 22 public: |
23 // Callback that updates UMA custom counts or custom times histograms. | 23 // Callback that updates UMA custom counts or custom times histograms. |
24 typedef base::Callback<void(const std::string& histogram_name, | 24 typedef base::Callback<void(const std::string& histogram_name, |
25 int64 value, | 25 int64_t value, |
26 int histogram_min, | 26 int histogram_min, |
27 int histogram_max, | 27 int histogram_max, |
28 int histogram_buckets)> | 28 int histogram_buckets)> |
29 UpdateUmaCustomHistogramCallback; | 29 UpdateUmaCustomHistogramCallback; |
30 | 30 |
31 // Callback that updates UMA enumeration histograms. | 31 // Callback that updates UMA enumeration histograms. |
32 typedef base::Callback< | 32 typedef base::Callback< |
33 void(const std::string& histogram_name, int64 value, int histogram_max)> | 33 void(const std::string& histogram_name, int64_t value, int histogram_max)> |
34 UpdateUmaEnumHistogramCallback; | 34 UpdateUmaEnumHistogramCallback; |
35 | 35 |
36 PerformanceTracker(); | 36 PerformanceTracker(); |
37 virtual ~PerformanceTracker(); | 37 virtual ~PerformanceTracker(); |
38 | 38 |
39 // Constant used to calculate the average for rate metrics and used by the | 39 // Constant used to calculate the average for rate metrics and used by the |
40 // plugin for the frequency at which stats should be updated. | 40 // plugin for the frequency at which stats should be updated. |
41 static const int kStatsUpdatePeriodSeconds = 1; | 41 static const int kStatsUpdatePeriodSeconds = 1; |
42 | 42 |
43 // Return rates and running-averages for different metrics. | 43 // Return rates and running-averages for different metrics. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 base::RepeatingTimer upload_uma_stats_timer_; | 105 base::RepeatingTimer upload_uma_stats_timer_; |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(PerformanceTracker); | 107 DISALLOW_COPY_AND_ASSIGN(PerformanceTracker); |
108 }; | 108 }; |
109 | 109 |
110 } // namespace protocol | 110 } // namespace protocol |
111 } // namespace remoting | 111 } // namespace remoting |
112 | 112 |
113 #endif // REMOTING_PROTOCOL_PERFORMANCE_TRACKER_H_ | 113 #endif // REMOTING_PROTOCOL_PERFORMANCE_TRACKER_H_ |
OLD | NEW |