OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 LOG(LS_INFO) << uma_prefix_ << "SentHeightInPixels " << sent_height; | 182 LOG(LS_INFO) << uma_prefix_ << "SentHeightInPixels " << sent_height; |
183 } | 183 } |
184 AggregatedStats sent_fps = sent_fps_counter_.GetStats(); | 184 AggregatedStats sent_fps = sent_fps_counter_.GetStats(); |
185 if (sent_fps.num_samples >= kMinRequiredPeriodicSamples) { | 185 if (sent_fps.num_samples >= kMinRequiredPeriodicSamples) { |
186 RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "SentFramesPerSecond", | 186 RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "SentFramesPerSecond", |
187 sent_fps.average); | 187 sent_fps.average); |
188 LOG(LS_INFO) << uma_prefix_ + "SentFramesPerSecond, " | 188 LOG(LS_INFO) << uma_prefix_ + "SentFramesPerSecond, " |
189 << sent_fps.ToString(); | 189 << sent_fps.ToString(); |
190 } | 190 } |
191 | 191 |
| 192 if (in_fps.num_samples > kMinRequiredPeriodicSamples && |
| 193 sent_fps.num_samples >= kMinRequiredPeriodicSamples) { |
| 194 int in_fps_avg = in_fps.average; |
| 195 if (in_fps_avg > 0) { |
| 196 int sent_fps_avg = sent_fps.average; |
| 197 int sent_to_in_fps_ratio_percent = |
| 198 (100 * sent_fps_avg + in_fps_avg / 2) / in_fps_avg; |
| 199 // If reported period is small, it may happen that sent_fps is larger than |
| 200 // input_fps briefly on average. This should be treated as 100% sent to |
| 201 // input ratio. |
| 202 if (sent_to_in_fps_ratio_percent > 100) |
| 203 sent_to_in_fps_ratio_percent = 100; |
| 204 RTC_HISTOGRAMS_PERCENTAGE(kIndex, |
| 205 uma_prefix_ + "SentToInputFpsRatioPercent", |
| 206 sent_to_in_fps_ratio_percent); |
| 207 LOG(LS_INFO) << uma_prefix_ << "SentToInputFpsRatioPercent " |
| 208 << sent_to_in_fps_ratio_percent; |
| 209 } |
| 210 } |
| 211 |
192 int encode_ms = encode_time_counter_.Avg(kMinRequiredMetricsSamples); | 212 int encode_ms = encode_time_counter_.Avg(kMinRequiredMetricsSamples); |
193 if (encode_ms != -1) { | 213 if (encode_ms != -1) { |
194 RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "EncodeTimeInMs", | 214 RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "EncodeTimeInMs", |
195 encode_ms); | 215 encode_ms); |
196 LOG(LS_INFO) << uma_prefix_ << "EncodeTimeInMs " << encode_ms; | 216 LOG(LS_INFO) << uma_prefix_ << "EncodeTimeInMs " << encode_ms; |
197 } | 217 } |
198 int key_frames_permille = | 218 int key_frames_permille = |
199 key_frame_counter_.Permille(kMinRequiredMetricsSamples); | 219 key_frame_counter_.Permille(kMinRequiredMetricsSamples); |
200 if (key_frames_permille != -1) { | 220 if (key_frames_permille != -1) { |
201 RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "KeyFramesSentInPermille", | 221 RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "KeyFramesSentInPermille", |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 } | 931 } |
912 | 932 |
913 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 933 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
914 int64_t min_required_samples, | 934 int64_t min_required_samples, |
915 float multiplier) const { | 935 float multiplier) const { |
916 if (num_samples < min_required_samples || num_samples == 0) | 936 if (num_samples < min_required_samples || num_samples == 0) |
917 return -1; | 937 return -1; |
918 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 938 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
919 } | 939 } |
920 } // namespace webrtc | 940 } // namespace webrtc |
OLD | NEW |