Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: webrtc/pc/statscollector.cc

Issue 3011623002: Add new ANA stats to GetStats() to count the number of actions taken by each controller. (Closed)
Patch Set: Addressed review comments. Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 for (const auto& f : floats) { 217 for (const auto& f : floats) {
218 report->AddFloat(f.name, f.value); 218 report->AddFloat(f.name, f.value);
219 } 219 }
220 220
221 for (const auto& i : ints) { 221 for (const auto& i : ints) {
222 if (i.value >= 0) { 222 if (i.value >= 0) {
223 report->AddInt(i.name, i.value); 223 report->AddInt(i.name, i.value);
224 } 224 }
225 } 225 }
226 report->AddString(StatsReport::kStatsValueNameMediaType, "audio"); 226 report->AddString(StatsReport::kStatsValueNameMediaType, "audio");
227 if (info.ana_bitrate_action_counter) {
228 report->AddInt(StatsReport::kStatsValueNameAnaBitrateActionCounter,
229 *info.ana_bitrate_action_counter);
230 }
231 if (info.ana_channel_action_counter) {
232 report->AddInt(StatsReport::kStatsValueNameAnaChannelActionCounter,
233 *info.ana_channel_action_counter);
234 }
235 if (info.ana_dtx_action_counter) {
236 report->AddInt(StatsReport::kStatsValueNameAnaDtxActionCounter,
237 *info.ana_dtx_action_counter);
238 }
239 if (info.ana_fec_action_counter) {
240 report->AddInt(StatsReport::kStatsValueNameAnaFecActionCounter,
241 *info.ana_fec_action_counter);
242 }
243 if (info.ana_frame_length_action_counter) {
244 report->AddInt(StatsReport::kStatsValueNameAnaFrameLengthActionCounter,
245 *info.ana_frame_length_action_counter);
246 }
hbos 2017/09/04 08:49:54 Can you add a statscollector_unittest.cc to cover
ivoc 2017/09/04 15:48:06 Done.
227 } 247 }
228 248
229 void ExtractStats(const cricket::VideoReceiverInfo& info, StatsReport* report) { 249 void ExtractStats(const cricket::VideoReceiverInfo& info, StatsReport* report) {
230 ExtractCommonReceiveProperties(info, report); 250 ExtractCommonReceiveProperties(info, report);
231 report->AddString(StatsReport::kStatsValueNameCodecImplementationName, 251 report->AddString(StatsReport::kStatsValueNameCodecImplementationName,
232 info.decoder_implementation_name); 252 info.decoder_implementation_name);
233 report->AddInt64(StatsReport::kStatsValueNameBytesReceived, 253 report->AddInt64(StatsReport::kStatsValueNameBytesReceived,
234 info.bytes_rcvd); 254 info.bytes_rcvd);
235 if (info.capture_start_ntp_time_ms >= 0) { 255 if (info.capture_start_ntp_time_ms >= 0) {
236 report->AddInt64(StatsReport::kStatsValueNameCaptureStartNtpTimeMs, 256 report->AddInt64(StatsReport::kStatsValueNameCaptureStartNtpTimeMs,
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 StatsReport* report = entry.second; 1046 StatsReport* report = entry.second;
1027 report->set_timestamp(stats_gathering_started_); 1047 report->set_timestamp(stats_gathering_started_);
1028 } 1048 }
1029 } 1049 }
1030 1050
1031 void StatsCollector::ClearUpdateStatsCacheForTest() { 1051 void StatsCollector::ClearUpdateStatsCacheForTest() {
1032 stats_gathering_started_ = 0; 1052 stats_gathering_started_ = 0;
1033 } 1053 }
1034 1054
1035 } // namespace webrtc 1055 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698