| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 UpdateUmaStats(now_ms, rtt, (fraction_loss * number_of_packets) >> 8); | 148 UpdateUmaStats(now_ms, rtt, (fraction_loss * number_of_packets) >> 8); |
| 149 } | 149 } |
| 150 | 150 |
| 151 void SendSideBandwidthEstimation::UpdateUmaStats(int64_t now_ms, | 151 void SendSideBandwidthEstimation::UpdateUmaStats(int64_t now_ms, |
| 152 int64_t rtt, | 152 int64_t rtt, |
| 153 int lost_packets) { | 153 int lost_packets) { |
| 154 int bitrate_kbps = static_cast<int>((bitrate_ + 500) / 1000); | 154 int bitrate_kbps = static_cast<int>((bitrate_ + 500) / 1000); |
| 155 for (size_t i = 0; i < kNumUmaRampupMetrics; ++i) { | 155 for (size_t i = 0; i < kNumUmaRampupMetrics; ++i) { |
| 156 if (!rampup_uma_stats_updated_[i] && | 156 if (!rampup_uma_stats_updated_[i] && |
| 157 bitrate_kbps >= kUmaRampupMetrics[i].bitrate_kbps) { | 157 bitrate_kbps >= kUmaRampupMetrics[i].bitrate_kbps) { |
| 158 RTC_HISTOGRAM_COUNTS_SPARSE_100000(kUmaRampupMetrics[i].metric_name, | 158 RTC_HISTOGRAMS_COUNTS_100000(i, kUmaRampupMetrics[i].metric_name, |
| 159 now_ms - first_report_time_ms_); | 159 now_ms - first_report_time_ms_); |
| 160 rampup_uma_stats_updated_[i] = true; | 160 rampup_uma_stats_updated_[i] = true; |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 if (IsInStartPhase(now_ms)) { | 163 if (IsInStartPhase(now_ms)) { |
| 164 initially_lost_packets_ += lost_packets; | 164 initially_lost_packets_ += lost_packets; |
| 165 } else if (uma_update_state_ == kNoUpdate) { | 165 } else if (uma_update_state_ == kNoUpdate) { |
| 166 uma_update_state_ = kFirstDone; | 166 uma_update_state_ = kFirstDone; |
| 167 bitrate_at_2_seconds_kbps_ = bitrate_kbps; | 167 bitrate_at_2_seconds_kbps_ = bitrate_kbps; |
| 168 RTC_HISTOGRAM_COUNTS("WebRTC.BWE.InitiallyLostPackets", | 168 RTC_HISTOGRAM_COUNTS("WebRTC.BWE.InitiallyLostPackets", |
| 169 initially_lost_packets_, 0, 100, 50); | 169 initially_lost_packets_, 0, 100, 50); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 bitrate = min_bitrate_configured_; | 299 bitrate = min_bitrate_configured_; |
| 300 } | 300 } |
| 301 return bitrate; | 301 return bitrate; |
| 302 } | 302 } |
| 303 | 303 |
| 304 void SendSideBandwidthEstimation::SetEventLog(RtcEventLog* event_log) { | 304 void SendSideBandwidthEstimation::SetEventLog(RtcEventLog* event_log) { |
| 305 event_log_ = event_log; | 305 event_log_ = event_log; |
| 306 } | 306 } |
| 307 | 307 |
| 308 } // namespace webrtc | 308 } // namespace webrtc |
| OLD | NEW |