| 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 19 matching lines...) Expand all Loading... |
| 30 stats_.ssrc = ssrc; | 30 stats_.ssrc = ssrc; |
| 31 } | 31 } |
| 32 | 32 |
| 33 ReceiveStatisticsProxy::~ReceiveStatisticsProxy() { | 33 ReceiveStatisticsProxy::~ReceiveStatisticsProxy() { |
| 34 UpdateHistograms(); | 34 UpdateHistograms(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void ReceiveStatisticsProxy::UpdateHistograms() { | 37 void ReceiveStatisticsProxy::UpdateHistograms() { |
| 38 int fraction_lost = report_block_stats_.FractionLostInPercent(); | 38 int fraction_lost = report_block_stats_.FractionLostInPercent(); |
| 39 if (fraction_lost != -1) { | 39 if (fraction_lost != -1) { |
| 40 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent", | 40 RTC_HISTOGRAM_PERCENTAGE_SPARSE("WebRTC.Video.ReceivedPacketsLostInPercent", |
| 41 fraction_lost); | 41 fraction_lost); |
| 42 } | 42 } |
| 43 const int kMinRequiredSamples = 200; | 43 const int kMinRequiredSamples = 200; |
| 44 int samples = static_cast<int>(render_fps_tracker_.TotalSampleCount()); | 44 int samples = static_cast<int>(render_fps_tracker_.TotalSampleCount()); |
| 45 if (samples > kMinRequiredSamples) { | 45 if (samples > kMinRequiredSamples) { |
| 46 RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.RenderFramesPerSecond", | 46 RTC_HISTOGRAM_COUNTS_SPARSE_100("WebRTC.Video.RenderFramesPerSecond", |
| 47 round(render_fps_tracker_.ComputeTotalRate())); | 47 round(render_fps_tracker_.ComputeTotalRate())); |
| 48 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.RenderSqrtPixelsPerSecond", | 48 RTC_HISTOGRAM_COUNTS_SPARSE_100000("WebRTC.Video.RenderSqrtPixelsPerSecond", |
| 49 round(render_pixel_tracker_.ComputeTotalRate())); | 49 round(render_pixel_tracker_.ComputeTotalRate())); |
| 50 } | 50 } |
| 51 int width = render_width_counter_.Avg(kMinRequiredSamples); | 51 int width = render_width_counter_.Avg(kMinRequiredSamples); |
| 52 int height = render_height_counter_.Avg(kMinRequiredSamples); | 52 int height = render_height_counter_.Avg(kMinRequiredSamples); |
| 53 if (width != -1) { | 53 if (width != -1) { |
| 54 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedWidthInPixels", width); | 54 RTC_HISTOGRAM_COUNTS_SPARSE_10000("WebRTC.Video.ReceivedWidthInPixels", |
| 55 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedHeightInPixels", height); | 55 width); |
| 56 RTC_HISTOGRAM_COUNTS_SPARSE_10000("WebRTC.Video.ReceivedHeightInPixels", |
| 57 height); |
| 56 } | 58 } |
| 57 int qp = qp_counters_.vp8.Avg(kMinRequiredSamples); | 59 int qp = qp_counters_.vp8.Avg(kMinRequiredSamples); |
| 58 if (qp != -1) | 60 if (qp != -1) |
| 59 RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp); | 61 RTC_HISTOGRAM_COUNTS_SPARSE_200("WebRTC.Video.Decoded.Vp8.Qp", qp); |
| 60 | 62 |
| 61 // TODO(asapersson): DecoderTiming() is call periodically (each 1000ms) and | 63 // TODO(asapersson): DecoderTiming() is call periodically (each 1000ms) and |
| 62 // not per frame. Change decode time to include every frame. | 64 // not per frame. Change decode time to include every frame. |
| 63 const int kMinRequiredDecodeSamples = 5; | 65 const int kMinRequiredDecodeSamples = 5; |
| 64 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples); | 66 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples); |
| 65 if (decode_ms != -1) | 67 if (decode_ms != -1) |
| 66 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); | 68 RTC_HISTOGRAM_COUNTS_SPARSE_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); |
| 67 | 69 |
| 68 int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples); | 70 int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples); |
| 69 if (delay_ms != -1) | 71 if (delay_ms != -1) |
| 70 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms); | 72 RTC_HISTOGRAM_COUNTS_SPARSE_10000("WebRTC.Video.OnewayDelayInMs", delay_ms); |
| 71 } | 73 } |
| 72 | 74 |
| 73 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { | 75 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { |
| 74 rtc::CritScope lock(&crit_); | 76 rtc::CritScope lock(&crit_); |
| 75 return stats_; | 77 return stats_; |
| 76 } | 78 } |
| 77 | 79 |
| 78 void ReceiveStatisticsProxy::OnIncomingPayloadType(int payload_type) { | 80 void ReceiveStatisticsProxy::OnIncomingPayloadType(int payload_type) { |
| 79 rtc::CritScope lock(&crit_); | 81 rtc::CritScope lock(&crit_); |
| 80 stats_.current_payload_type = payload_type; | 82 stats_.current_payload_type = payload_type; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 ++num_samples; | 203 ++num_samples; |
| 202 } | 204 } |
| 203 | 205 |
| 204 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { | 206 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { |
| 205 if (num_samples < min_required_samples || num_samples == 0) | 207 if (num_samples < min_required_samples || num_samples == 0) |
| 206 return -1; | 208 return -1; |
| 207 return sum / num_samples; | 209 return sum / num_samples; |
| 208 } | 210 } |
| 209 | 211 |
| 210 } // namespace webrtc | 212 } // namespace webrtc |
| OLD | NEW |