Chromium Code Reviews| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 | 305 |
| 306 int64_t one_way_delay_ms = rtt_ms / 2; | 306 int64_t one_way_delay_ms = rtt_ms / 2; |
| 307 DelayFilter delay_uplink(&uplink_, all_flow_ids); | 307 DelayFilter delay_uplink(&uplink_, all_flow_ids); |
| 308 delay_uplink.SetOneWayDelayMs(one_way_delay_ms); | 308 delay_uplink.SetOneWayDelayMs(one_way_delay_ms); |
| 309 | 309 |
| 310 JitterFilter jitter(&uplink_, all_flow_ids); | 310 JitterFilter jitter(&uplink_, all_flow_ids); |
| 311 jitter.SetMaxJitter(max_jitter_ms); | 311 jitter.SetMaxJitter(max_jitter_ms); |
| 312 | 312 |
| 313 std::vector<RateCounterFilter*> rate_counters; | 313 std::vector<RateCounterFilter*> rate_counters; |
| 314 for (int flow : all_flow_ids) { | 314 for (int flow : all_flow_ids) { |
| 315 rate_counters.push_back( | 315 rate_counters.push_back(new RateCounterFilter(&uplink_, flow, "Receiver")); |
| 316 new RateCounterFilter(&uplink_, flow, "receiver_input")); | |
| 317 } | 316 } |
| 318 | 317 |
| 319 RateCounterFilter total_utilization(&uplink_, all_flow_ids, | 318 RateCounterFilter total_utilization(&uplink_, all_flow_ids, |
| 320 "total_utilization"); | 319 "total_utilization"); |
| 321 | 320 |
| 322 std::vector<PacketReceiver*> receivers; | 321 std::vector<PacketReceiver*> receivers; |
| 323 // Delays is being plotted only for the first flow. | 322 // Delays is being plotted only for the first flow. |
| 324 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). | 323 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). |
| 325 for (int media_flow : media_flow_ids) { | 324 for (int media_flow : media_flow_ids) { |
| 326 metric_recorders.push_back( | 325 metric_recorders.push_back( |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 486 senders.push_back(new VideoSender(&uplink_, sources[i], bwe_type)); | 485 senders.push_back(new VideoSender(&uplink_, sources[i], bwe_type)); |
| 487 } | 486 } |
| 488 | 487 |
| 489 FlowIds flow_ids = CreateFlowIdRange(0, static_cast<int>(num_flows - 1)); | 488 FlowIds flow_ids = CreateFlowIdRange(0, static_cast<int>(num_flows - 1)); |
| 490 | 489 |
| 491 DefaultEvaluationFilter up_filter(&uplink_, flow_ids); | 490 DefaultEvaluationFilter up_filter(&uplink_, flow_ids); |
| 492 LinkShare link_share(&(up_filter.choke)); | 491 LinkShare link_share(&(up_filter.choke)); |
| 493 | 492 |
| 494 RateCounterFilter total_utilization(&uplink_, flow_ids, "Total_utilization"); | 493 RateCounterFilter total_utilization(&uplink_, flow_ids, "Total_utilization"); |
| 495 | 494 |
| 496 // Delays is being plotted only for the first flow. | |
| 497 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). | |
| 498 for (size_t i = 0; i < num_flows; ++i) { | 495 for (size_t i = 0; i < num_flows; ++i) { |
| 499 metric_recorders.push_back(new MetricRecorder( | 496 metric_recorders.push_back(new MetricRecorder( |
| 500 bwe_names[bwe_type], static_cast<int>(i), senders[i], &link_share)); | 497 bwe_names[bwe_type], static_cast<int>(i), senders[i], &link_share)); |
| 501 | 498 |
| 502 receivers.push_back(new PacketReceiver(&uplink_, static_cast<int>(i), | 499 receivers.push_back(new PacketReceiver(&uplink_, static_cast<int>(i), |
| 503 bwe_type, i == 0, false, | 500 bwe_type, false, false, |
|
stefan-webrtc
2015/07/24 09:30:42
Who is responsible for plotting delays in this tes
magalhaesc
2015/07/24 11:46:40
The delay is being plotted by the metric_recorder.
| |
| 504 metric_recorders[i])); | 501 metric_recorders[i])); |
| 505 metric_recorders[i]->set_plot_available_capacity( | 502 metric_recorders[i]->set_plot_available_capacity( |
| 506 i == 0 && plot_total_available_capacity_); | 503 i == 0 && plot_total_available_capacity_); |
| 507 } | 504 } |
| 508 | 505 |
| 509 DelayFilter down_filter(&downlink_, flow_ids); | 506 DelayFilter down_filter(&downlink_, flow_ids); |
| 510 down_filter.SetOneWayDelayMs(kOneWayDelayMs); | 507 down_filter.SetOneWayDelayMs(kOneWayDelayMs); |
| 511 // Test also with one way propagation delay = 100ms. | 508 // Test also with one way propagation delay = 100ms. |
| 512 // up_filter.delay.SetOneWayDelayMs(100); | 509 // up_filter.delay.SetOneWayDelayMs(100); |
| 513 // down_filter.SetOneWayDelayMs(100); | 510 // down_filter.SetOneWayDelayMs(100); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 561 sources[kBackward].reset(new AdaptiveVideoSource(kBackward, 30, 300, 0, 0)); | 558 sources[kBackward].reset(new AdaptiveVideoSource(kBackward, 30, 300, 0, 0)); |
| 562 senders[kBackward].reset( | 559 senders[kBackward].reset( |
| 563 new VideoSender(&downlink_, sources[kBackward].get(), bwe_type)); | 560 new VideoSender(&downlink_, sources[kBackward].get(), bwe_type)); |
| 564 | 561 |
| 565 DefaultEvaluationFilter up_filter(&uplink_, kForward); | 562 DefaultEvaluationFilter up_filter(&uplink_, kForward); |
| 566 LinkShare up_link_share(&(up_filter.choke)); | 563 LinkShare up_link_share(&(up_filter.choke)); |
| 567 | 564 |
| 568 metric_recorders[kForward].reset(new MetricRecorder( | 565 metric_recorders[kForward].reset(new MetricRecorder( |
| 569 bwe_names[bwe_type], kForward, senders[kForward].get(), &up_link_share)); | 566 bwe_names[bwe_type], kForward, senders[kForward].get(), &up_link_share)); |
| 570 receivers[kForward].reset( | 567 receivers[kForward].reset( |
| 571 new PacketReceiver(&uplink_, kForward, bwe_type, true, false, | 568 new PacketReceiver(&uplink_, kForward, bwe_type, false, false, |
| 572 metric_recorders[kForward].get())); | 569 metric_recorders[kForward].get())); |
| 573 | 570 |
| 574 metric_recorders[kForward].get()->set_plot_available_capacity( | 571 metric_recorders[kForward].get()->set_plot_available_capacity( |
| 575 plot_total_available_capacity_); | 572 plot_total_available_capacity_); |
| 576 | 573 |
| 577 DefaultEvaluationFilter down_filter(&downlink_, kBackward); | 574 DefaultEvaluationFilter down_filter(&downlink_, kBackward); |
| 578 LinkShare down_link_share(&(down_filter.choke)); | 575 LinkShare down_link_share(&(down_filter.choke)); |
| 579 | 576 |
| 580 metric_recorders[kBackward].reset( | 577 metric_recorders[kBackward].reset( |
| 581 new MetricRecorder(bwe_names[bwe_type], kBackward, | 578 new MetricRecorder(bwe_names[bwe_type], kBackward, |
| 582 senders[kBackward].get(), &down_link_share)); | 579 senders[kBackward].get(), &down_link_share)); |
| 583 receivers[kBackward].reset( | 580 receivers[kBackward].reset( |
| 584 new PacketReceiver(&downlink_, kBackward, bwe_type, true, false, | 581 new PacketReceiver(&downlink_, kBackward, bwe_type, false, false, |
| 585 metric_recorders[kBackward].get())); | 582 metric_recorders[kBackward].get())); |
| 586 | 583 |
| 587 metric_recorders[kBackward].get()->set_plot_available_capacity( | 584 metric_recorders[kBackward].get()->set_plot_available_capacity( |
| 588 plot_total_available_capacity_); | 585 plot_total_available_capacity_); |
| 589 | 586 |
| 590 // Test also with one way propagation delay = 100ms. | 587 // Test also with one way propagation delay = 100ms. |
| 591 // up_filter.delay.SetOneWayDelayMs(100); | 588 // up_filter.delay.SetOneWayDelayMs(100); |
| 592 // down_filter.delay.SetOneWayDelayMs(100); | 589 // down_filter.delay.SetOneWayDelayMs(100); |
| 593 | 590 |
| 594 up_filter.choke.set_capacity_kbps(2000); | 591 up_filter.choke.set_capacity_kbps(2000); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 677 JitterFilter jitter_filter(&uplink_, CreateFlowIds(kAllFlowIds, kNumFlows)); | 674 JitterFilter jitter_filter(&uplink_, CreateFlowIds(kAllFlowIds, kNumFlows)); |
| 678 | 675 |
| 679 rtc::scoped_ptr<DelayFilter> up_delay_filters[kNumFlows]; | 676 rtc::scoped_ptr<DelayFilter> up_delay_filters[kNumFlows]; |
| 680 for (size_t i = 0; i < kNumFlows; ++i) { | 677 for (size_t i = 0; i < kNumFlows; ++i) { |
| 681 up_delay_filters[i].reset(new DelayFilter(&uplink_, kAllFlowIds[i])); | 678 up_delay_filters[i].reset(new DelayFilter(&uplink_, kAllFlowIds[i])); |
| 682 } | 679 } |
| 683 | 680 |
| 684 RateCounterFilter total_utilization( | 681 RateCounterFilter total_utilization( |
| 685 &uplink_, CreateFlowIds(kAllFlowIds, kNumFlows), "Total_utilization"); | 682 &uplink_, CreateFlowIds(kAllFlowIds, kNumFlows), "Total_utilization"); |
| 686 | 683 |
| 687 // Delays is being plotted only for the first flow. | |
| 688 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). | |
| 689 rtc::scoped_ptr<PacketReceiver> receivers[kNumFlows]; | 684 rtc::scoped_ptr<PacketReceiver> receivers[kNumFlows]; |
| 690 for (size_t i = 0; i < kNumFlows; ++i) { | 685 for (size_t i = 0; i < kNumFlows; ++i) { |
| 691 metric_recorders[i].reset( | 686 metric_recorders[i].reset( |
| 692 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(i), | 687 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(i), |
| 693 senders[i].get(), &link_share)); | 688 senders[i].get(), &link_share)); |
| 694 | 689 |
| 695 receivers[i].reset(new PacketReceiver(&uplink_, kAllFlowIds[i], bwe_type, | 690 receivers[i].reset(new PacketReceiver(&uplink_, kAllFlowIds[i], bwe_type, |
| 696 i == 0, false, | 691 false, false, |
| 697 metric_recorders[i].get())); | 692 metric_recorders[i].get())); |
| 698 metric_recorders[i].get()->set_start_computing_metrics_ms(kStartingApartMs * | 693 metric_recorders[i].get()->set_start_computing_metrics_ms(kStartingApartMs * |
| 699 (kNumFlows - 1)); | 694 (kNumFlows - 1)); |
| 700 metric_recorders[i].get()->set_plot_available_capacity( | 695 metric_recorders[i].get()->set_plot_available_capacity( |
| 701 i == 0 && plot_total_available_capacity_); | 696 i == 0 && plot_total_available_capacity_); |
| 702 } | 697 } |
| 703 | 698 |
| 704 rtc::scoped_ptr<DelayFilter> down_delay_filters[kNumFlows]; | 699 rtc::scoped_ptr<DelayFilter> down_delay_filters[kNumFlows]; |
| 705 for (size_t i = 0; i < kNumFlows; ++i) { | 700 for (size_t i = 0; i < kNumFlows; ++i) { |
| 706 down_delay_filters[i].reset(new DelayFilter(&downlink_, kAllFlowIds[i])); | 701 down_delay_filters[i].reset(new DelayFilter(&downlink_, kAllFlowIds[i])); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 792 tcp_file_sizes_bytes[id - kNumRmcatFlows])); | 787 tcp_file_sizes_bytes[id - kNumRmcatFlows])); |
| 793 } | 788 } |
| 794 | 789 |
| 795 FlowIds flow_ids = CreateFlowIdRange(0, static_cast<int>(kNumTotalFlows - 1)); | 790 FlowIds flow_ids = CreateFlowIdRange(0, static_cast<int>(kNumTotalFlows - 1)); |
| 796 DefaultEvaluationFilter up_filter(&uplink_, flow_ids); | 791 DefaultEvaluationFilter up_filter(&uplink_, flow_ids); |
| 797 | 792 |
| 798 LinkShare link_share(&(up_filter.choke)); | 793 LinkShare link_share(&(up_filter.choke)); |
| 799 | 794 |
| 800 RateCounterFilter total_utilization(&uplink_, flow_ids, "Total_utilization"); | 795 RateCounterFilter total_utilization(&uplink_, flow_ids, "Total_utilization"); |
| 801 | 796 |
| 802 // Delays is being plotted only for the first flow. | |
| 803 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). | |
| 804 for (size_t id : kAllRmcatFlowIds) { | 797 for (size_t id : kAllRmcatFlowIds) { |
| 805 metric_recorders[id].reset( | 798 metric_recorders[id].reset( |
| 806 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(id), | 799 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(id), |
| 807 senders[id].get(), &link_share)); | 800 senders[id].get(), &link_share)); |
| 808 receivers[id].reset(new PacketReceiver(&uplink_, static_cast<int>(id), | 801 receivers[id].reset(new PacketReceiver(&uplink_, static_cast<int>(id), |
| 809 bwe_type, id == 0, false, | 802 bwe_type, false, false, |
| 810 metric_recorders[id].get())); | 803 metric_recorders[id].get())); |
| 811 metric_recorders[id].get()->set_start_computing_metrics_ms( | 804 metric_recorders[id].get()->set_start_computing_metrics_ms( |
| 812 kRmcatStartingTimeMs); | 805 kRmcatStartingTimeMs); |
| 813 metric_recorders[id].get()->set_plot_available_capacity( | 806 metric_recorders[id].get()->set_plot_available_capacity( |
| 814 id == 0 && plot_total_available_capacity_); | 807 id == 0 && plot_total_available_capacity_); |
| 815 } | 808 } |
| 816 | 809 |
| 817 // Delays is not being plotted only for TCP flows. To plot all of them, | |
| 818 // replace first "false" occurence with "true" on new PacketReceiver(). | |
| 819 for (size_t id : kAllTcpFlowIds) { | 810 for (size_t id : kAllTcpFlowIds) { |
| 820 metric_recorders[id].reset( | 811 metric_recorders[id].reset( |
| 821 new MetricRecorder(bwe_names[kTcpEstimator], static_cast<int>(id), | 812 new MetricRecorder(bwe_names[kTcpEstimator], static_cast<int>(id), |
| 822 senders[id].get(), &link_share)); | 813 senders[id].get(), &link_share)); |
| 823 receivers[id].reset(new PacketReceiver(&uplink_, static_cast<int>(id), | 814 receivers[id].reset(new PacketReceiver(&uplink_, static_cast<int>(id), |
| 824 kTcpEstimator, false, false, | 815 kTcpEstimator, false, false, |
| 825 metric_recorders[id].get())); | 816 metric_recorders[id].get())); |
| 826 metric_recorders[id].get()->set_plot_available_capacity( | 817 metric_recorders[id].get()->set_plot_available_capacity( |
| 827 id == 0 && plot_total_available_capacity_); | 818 id == 0 && plot_total_available_capacity_); |
| 828 } | 819 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 879 } | 870 } |
| 880 | 871 |
| 881 DefaultEvaluationFilter filter(&uplink_, | 872 DefaultEvaluationFilter filter(&uplink_, |
| 882 CreateFlowIds(kAllFlowIds, kNumFlows)); | 873 CreateFlowIds(kAllFlowIds, kNumFlows)); |
| 883 | 874 |
| 884 LinkShare link_share(&(filter.choke)); | 875 LinkShare link_share(&(filter.choke)); |
| 885 | 876 |
| 886 RateCounterFilter total_utilization( | 877 RateCounterFilter total_utilization( |
| 887 &uplink_, CreateFlowIds(kAllFlowIds, kNumFlows), "Total_utilization"); | 878 &uplink_, CreateFlowIds(kAllFlowIds, kNumFlows), "Total_utilization"); |
| 888 | 879 |
| 889 // Delays is being plotted only for the first flow. | |
| 890 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). | |
| 891 for (size_t i = 0; i < kNumFlows; ++i) { | 880 for (size_t i = 0; i < kNumFlows; ++i) { |
| 892 metric_recorders[i].reset( | 881 metric_recorders[i].reset( |
| 893 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(i), | 882 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(i), |
| 894 senders[i].get(), &link_share)); | 883 senders[i].get(), &link_share)); |
| 895 receivers[i].reset(new PacketReceiver(&uplink_, kAllFlowIds[i], bwe_type, | 884 receivers[i].reset(new PacketReceiver(&uplink_, kAllFlowIds[i], bwe_type, |
| 896 i == 0, false, | 885 false, false, |
| 897 metric_recorders[i].get())); | 886 metric_recorders[i].get())); |
| 898 metric_recorders[i].get()->set_start_computing_metrics_ms(kStartingApartMs * | 887 metric_recorders[i].get()->set_start_computing_metrics_ms(kStartingApartMs * |
| 899 (kNumFlows - 1)); | 888 (kNumFlows - 1)); |
| 900 metric_recorders[i].get()->set_plot_available_capacity( | 889 metric_recorders[i].get()->set_plot_available_capacity( |
| 901 i == 0 && plot_total_available_capacity_); | 890 i == 0 && plot_total_available_capacity_); |
| 902 } | 891 } |
| 903 | 892 |
| 904 // Test also with one way propagation delay = 100ms. | 893 // Test also with one way propagation delay = 100ms. |
| 905 // filter.delay.SetOneWayDelayMs(100); | 894 // filter.delay.SetOneWayDelayMs(100); |
| 906 filter.choke.set_capacity_kbps(3500); | 895 filter.choke.set_capacity_kbps(3500); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 970 tcp_starting_times_ms.push_back( | 959 tcp_starting_times_ms.push_back( |
| 971 static_cast<int64_t>(random.Exponential(1.0f / kMeanMs))); | 960 static_cast<int64_t>(random.Exponential(1.0f / kMeanMs))); |
| 972 } | 961 } |
| 973 | 962 |
| 974 return tcp_starting_times_ms; | 963 return tcp_starting_times_ms; |
| 975 } | 964 } |
| 976 | 965 |
| 977 } // namespace bwe | 966 } // namespace bwe |
| 978 } // namespace testing | 967 } // namespace testing |
| 979 } // namespace webrtc | 968 } // namespace webrtc |
| OLD | NEW |