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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/bwe_test.cc

Issue 2708723002: added WebRTC-QuickPerfTest to RampUpTests and CallPerfTests (Closed)
Patch Set: added QuickPerfTest field-trial to NetEq and VideoSender/BWE tests Created 3 years, 10 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 (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
11 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test.h" 11 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test.h"
12 12
13 #include <memory> 13 #include <memory>
14 #include <sstream> 14 #include <sstream>
15 15
16 #include "webrtc/base/arraysize.h" 16 #include "webrtc/base/arraysize.h"
17 #include "webrtc/modules/include/module_common_types.h" 17 #include "webrtc/modules/include/module_common_types.h"
18 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h" 18 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h"
19 #include "webrtc/modules/remote_bitrate_estimator/test/metric_recorder.h" 19 #include "webrtc/modules/remote_bitrate_estimator/test/metric_recorder.h"
20 #include "webrtc/modules/remote_bitrate_estimator/test/packet_receiver.h" 20 #include "webrtc/modules/remote_bitrate_estimator/test/packet_receiver.h"
21 #include "webrtc/modules/remote_bitrate_estimator/test/packet_sender.h" 21 #include "webrtc/modules/remote_bitrate_estimator/test/packet_sender.h"
22 #include "webrtc/system_wrappers/include/clock.h" 22 #include "webrtc/system_wrappers/include/clock.h"
23 #include "webrtc/system_wrappers/include/field_trial.h"
23 #include "webrtc/test/testsupport/perf_test.h" 24 #include "webrtc/test/testsupport/perf_test.h"
24 25
25 using std::vector; 26 using std::vector;
26 27
28
29 namespace {
30 const int kQuickTestTimeoutMs = 500;
31 }
32
27 namespace webrtc { 33 namespace webrtc {
28 namespace testing { 34 namespace testing {
29 namespace bwe { 35 namespace bwe {
30 36
31 PacketProcessorRunner::PacketProcessorRunner(PacketProcessor* processor) 37 PacketProcessorRunner::PacketProcessorRunner(PacketProcessor* processor)
32 : processor_(processor) { 38 : processor_(processor) {
33 } 39 }
34 40
35 PacketProcessorRunner::~PacketProcessorRunner() { 41 PacketProcessorRunner::~PacketProcessorRunner() {
36 for (Packet* packet : queue_) 42 for (Packet* packet : queue_)
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 159 }
154 } 160 }
155 161
156 void BweTest::VerboseLogging(bool enable) { 162 void BweTest::VerboseLogging(bool enable) {
157 BWE_TEST_LOGGING_GLOBAL_ENABLE(enable); 163 BWE_TEST_LOGGING_GLOBAL_ENABLE(enable);
158 } 164 }
159 165
160 void BweTest::RunFor(int64_t time_ms) { 166 void BweTest::RunFor(int64_t time_ms) {
161 // Set simulation interval from first packet sender. 167 // Set simulation interval from first packet sender.
162 // TODO(holmer): Support different feedback intervals for different flows. 168 // TODO(holmer): Support different feedback intervals for different flows.
169
170 // For quick perf tests ignore passed timeout
171 if (field_trial::FindFullName("WebRTC-QuickPerfTest") == "Enabled") {
172 time_ms = kQuickTestTimeoutMs;
173 }
163 if (!uplink_.senders().empty()) { 174 if (!uplink_.senders().empty()) {
164 simulation_interval_ms_ = uplink_.senders()[0]->GetFeedbackIntervalMs(); 175 simulation_interval_ms_ = uplink_.senders()[0]->GetFeedbackIntervalMs();
165 } else if (!downlink_.senders().empty()) { 176 } else if (!downlink_.senders().empty()) {
166 simulation_interval_ms_ = downlink_.senders()[0]->GetFeedbackIntervalMs(); 177 simulation_interval_ms_ = downlink_.senders()[0]->GetFeedbackIntervalMs();
167 } 178 }
168 assert(simulation_interval_ms_ > 0); 179 assert(simulation_interval_ms_ > 0);
169 if (time_now_ms_ == -1) { 180 if (time_now_ms_ == -1) {
170 time_now_ms_ = simulation_interval_ms_; 181 time_now_ms_ = simulation_interval_ms_;
171 } 182 }
172 for (run_time_ms_ += time_ms; 183 for (run_time_ms_ += time_ms;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 374
364 std::map<int, Stats<double>> flow_delay_ms; 375 std::map<int, Stats<double>> flow_delay_ms;
365 for (PacketReceiver* receiver : receivers) { 376 for (PacketReceiver* receiver : receivers) {
366 int flow_id = *receiver->flow_ids().begin(); 377 int flow_id = *receiver->flow_ids().begin();
367 flow_delay_ms[flow_id] = receiver->GetDelayStats(); 378 flow_delay_ms[flow_id] = receiver->GetDelayStats();
368 } 379 }
369 380
370 PrintResults(capacity_kbps, total_utilization.GetBitrateStats(), 381 PrintResults(capacity_kbps, total_utilization.GetBitrateStats(),
371 flow_delay_ms, flow_throughput_kbps); 382 flow_delay_ms, flow_throughput_kbps);
372 383
373 for (int i : all_flow_ids) { 384 if (field_trial::FindFullName("WebRTC-QuickPerfTest") != "Enabled") {
374 metric_recorders[i]->PlotThroughputHistogram( 385 for (int i : all_flow_ids) {
375 title, flow_name, static_cast<int>(num_media_flows), 0); 386 metric_recorders[i]->PlotThroughputHistogram(
387 title, flow_name, static_cast<int>(num_media_flows), 0);
376 388
377 metric_recorders[i]->PlotLossHistogram(title, flow_name, 389 metric_recorders[i]->PlotLossHistogram(title, flow_name,
378 static_cast<int>(num_media_flows), 390 static_cast<int>(num_media_flows),
379 receivers[i]->GlobalPacketLoss()); 391 receivers[i]->GlobalPacketLoss());
380 } 392 }
381 393
382 // Pointless to show delay histogram for TCP flow. 394 // Pointless to show delay histogram for TCP flow.
383 for (int i : media_flow_ids) { 395 for (int i : media_flow_ids) {
384 metric_recorders[i]->PlotDelayHistogram(title, bwe_names[bwe_type], 396 metric_recorders[i]->PlotDelayHistogram(title, bwe_names[bwe_type],
385 static_cast<int>(num_media_flows), 397 static_cast<int>(num_media_flows),
386 one_way_delay_ms); 398 one_way_delay_ms);
387 BWE_TEST_LOGGING_BASELINEBAR(5, bwe_names[bwe_type], one_way_delay_ms, i); 399 BWE_TEST_LOGGING_BASELINEBAR(5, bwe_names[bwe_type], one_way_delay_ms, i);
400 }
388 } 401 }
389 402
390 for (VideoSource* source : sources) 403 for (VideoSource* source : sources)
391 delete source; 404 delete source;
392 for (PacketSender* sender : senders) 405 for (PacketSender* sender : senders)
393 delete sender; 406 delete sender;
394 for (RateCounterFilter* rate_counter : rate_counters) 407 for (RateCounterFilter* rate_counter : rate_counters)
395 delete rate_counter; 408 delete rate_counter;
396 for (PacketReceiver* receiver : receivers) 409 for (PacketReceiver* receiver : receivers)
397 delete receiver; 410 delete receiver;
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 tcp_starting_times_ms.push_back( 987 tcp_starting_times_ms.push_back(
975 static_cast<int64_t>(random.Exponential(1.0f / kMeanMs))); 988 static_cast<int64_t>(random.Exponential(1.0f / kMeanMs)));
976 } 989 }
977 990
978 return tcp_starting_times_ms; 991 return tcp_starting_times_ms;
979 } 992 }
980 993
981 } // namespace bwe 994 } // namespace bwe
982 } // namespace testing 995 } // namespace testing
983 } // namespace webrtc 996 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698