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