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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 max_sent_width_per_timestamp_(0), | 63 max_sent_width_per_timestamp_(0), |
64 max_sent_height_per_timestamp_(0) { | 64 max_sent_height_per_timestamp_(0) { |
65 UpdateCodecTypeHistogram(config_.encoder_settings.payload_name); | 65 UpdateCodecTypeHistogram(config_.encoder_settings.payload_name); |
66 } | 66 } |
67 | 67 |
68 SendStatisticsProxy::~SendStatisticsProxy() { | 68 SendStatisticsProxy::~SendStatisticsProxy() { |
69 UpdateHistograms(); | 69 UpdateHistograms(); |
70 } | 70 } |
71 | 71 |
72 void SendStatisticsProxy::UpdateHistograms() { | 72 void SendStatisticsProxy::UpdateHistograms() { |
73 int input_fps = | |
74 round(input_frame_rate_tracker_.ComputeTotalRate()); | |
75 if (input_fps > 0) | |
76 RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.InputFramesPerSecond", input_fps); | |
77 int sent_fps = | |
78 round(sent_frame_rate_tracker_.ComputeTotalRate()); | |
79 if (sent_fps > 0) | |
80 RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.SentFramesPerSecond", sent_fps); | |
81 | |
82 const int kMinRequiredSamples = 200; | 73 const int kMinRequiredSamples = 200; |
83 int in_width = input_width_counter_.Avg(kMinRequiredSamples); | 74 int in_width = input_width_counter_.Avg(kMinRequiredSamples); |
84 int in_height = input_height_counter_.Avg(kMinRequiredSamples); | 75 int in_height = input_height_counter_.Avg(kMinRequiredSamples); |
| 76 int in_fps = round(input_frame_rate_tracker_.ComputeTotalRate()); |
85 if (in_width != -1) { | 77 if (in_width != -1) { |
86 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.InputWidthInPixels", in_width); | 78 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.InputWidthInPixels", in_width); |
87 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.InputHeightInPixels", in_height); | 79 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.InputHeightInPixels", in_height); |
| 80 RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.InputFramesPerSecond", in_fps); |
88 } | 81 } |
89 int sent_width = sent_width_counter_.Avg(kMinRequiredSamples); | 82 int sent_width = sent_width_counter_.Avg(kMinRequiredSamples); |
90 int sent_height = sent_height_counter_.Avg(kMinRequiredSamples); | 83 int sent_height = sent_height_counter_.Avg(kMinRequiredSamples); |
| 84 int sent_fps = round(sent_frame_rate_tracker_.ComputeTotalRate()); |
91 if (sent_width != -1) { | 85 if (sent_width != -1) { |
92 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.SentWidthInPixels", sent_width); | 86 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.SentWidthInPixels", sent_width); |
93 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.SentHeightInPixels", sent_height); | 87 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.SentHeightInPixels", sent_height); |
| 88 RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.SentFramesPerSecond", sent_fps); |
94 } | 89 } |
95 int encode_ms = encode_time_counter_.Avg(kMinRequiredSamples); | 90 int encode_ms = encode_time_counter_.Avg(kMinRequiredSamples); |
96 if (encode_ms != -1) | 91 if (encode_ms != -1) |
97 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.EncodeTimeInMs", encode_ms); | 92 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.EncodeTimeInMs", encode_ms); |
98 | 93 |
99 int key_frames_permille = key_frame_counter_.Permille(kMinRequiredSamples); | 94 int key_frames_permille = key_frame_counter_.Permille(kMinRequiredSamples); |
100 if (key_frames_permille != -1) { | 95 if (key_frames_permille != -1) { |
101 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesSentInPermille", | 96 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesSentInPermille", |
102 key_frames_permille); | 97 key_frames_permille); |
103 } | 98 } |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 } | 375 } |
381 | 376 |
382 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 377 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
383 int min_required_samples, float multiplier) const { | 378 int min_required_samples, float multiplier) const { |
384 if (num_samples < min_required_samples || num_samples == 0) | 379 if (num_samples < min_required_samples || num_samples == 0) |
385 return -1; | 380 return -1; |
386 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 381 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
387 } | 382 } |
388 | 383 |
389 } // namespace webrtc | 384 } // namespace webrtc |
OLD | NEW |