| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2013 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 #endif // ENABLE_PROFILING | 84 #endif // ENABLE_PROFILING |
| 85 | 85 |
| 86 namespace rtc { | 86 namespace rtc { |
| 87 | 87 |
| 88 // Tracks information for one profiler event. | 88 // Tracks information for one profiler event. |
| 89 class ProfilerEvent { | 89 class ProfilerEvent { |
| 90 public: | 90 public: |
| 91 ProfilerEvent(); | 91 ProfilerEvent(); |
| 92 void Start(); | 92 void Start(); |
| 93 void Stop(); | 93 void Stop(); |
| 94 void Stop(uint64 stop_time); | 94 void Stop(uint64_t stop_time); |
| 95 double standard_deviation() const; | 95 double standard_deviation() const; |
| 96 double total_time() const { return total_time_; } | 96 double total_time() const { return total_time_; } |
| 97 double mean() const { return mean_; } | 97 double mean() const { return mean_; } |
| 98 double minimum() const { return minimum_; } | 98 double minimum() const { return minimum_; } |
| 99 double maximum() const { return maximum_; } | 99 double maximum() const { return maximum_; } |
| 100 int event_count() const { return event_count_; } | 100 int event_count() const { return event_count_; } |
| 101 bool is_started() const { return start_count_ > 0; } | 101 bool is_started() const { return start_count_ > 0; } |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 uint64 current_start_time_; | 104 uint64_t current_start_time_; |
| 105 double total_time_; | 105 double total_time_; |
| 106 double mean_; | 106 double mean_; |
| 107 double sum_of_squared_differences_; | 107 double sum_of_squared_differences_; |
| 108 double minimum_; | 108 double minimum_; |
| 109 double maximum_; | 109 double maximum_; |
| 110 int start_count_; | 110 int start_count_; |
| 111 int event_count_; | 111 int event_count_; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 // Singleton that owns ProfilerEvents and reports results. Prefer to use | 114 // Singleton that owns ProfilerEvents and reports results. Prefer to use |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 RTC_DISALLOW_COPY_AND_ASSIGN(ProfilerScope); | 154 RTC_DISALLOW_COPY_AND_ASSIGN(ProfilerScope); |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 std::ostream& operator<<(std::ostream& stream, | 157 std::ostream& operator<<(std::ostream& stream, |
| 158 const ProfilerEvent& profiler_event); | 158 const ProfilerEvent& profiler_event); |
| 159 | 159 |
| 160 } // namespace rtc | 160 } // namespace rtc |
| 161 | 161 |
| 162 #endif // WEBRTC_BASE_PROFILER_H_ | 162 #endif // WEBRTC_BASE_PROFILER_H_ |
| OLD | NEW |