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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 LinkShare link_share(&choke); | 304 LinkShare link_share(&choke); |
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 : media_flow_ids) { |
315 rate_counters.push_back( | 315 rate_counters.push_back( |
316 new RateCounterFilter(&uplink_, flow, "receiver_input")); | 316 new RateCounterFilter(&uplink_, flow, "Receiver", bwe_names[bwe_type])); |
| 317 } |
| 318 for (int flow : tcp_flow_ids) { |
| 319 rate_counters.push_back(new RateCounterFilter(&uplink_, flow, "Receiver", |
| 320 bwe_names[kTcpEstimator])); |
317 } | 321 } |
318 | 322 |
319 RateCounterFilter total_utilization(&uplink_, all_flow_ids, | 323 RateCounterFilter total_utilization( |
320 "total_utilization"); | 324 &uplink_, all_flow_ids, "total_utilization", "Total_link_utilization"); |
321 | 325 |
322 std::vector<PacketReceiver*> receivers; | 326 std::vector<PacketReceiver*> receivers; |
323 // Delays is being plotted only for the first flow. | 327 // Delays is being plotted only for the first flow. |
324 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). | 328 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). |
325 for (int media_flow : media_flow_ids) { | 329 for (int media_flow : media_flow_ids) { |
326 metric_recorders.push_back( | 330 metric_recorders.push_back( |
327 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(media_flow), | 331 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(media_flow), |
328 senders[media_flow], &link_share)); | 332 senders[media_flow], &link_share)); |
329 receivers.push_back(new PacketReceiver(&uplink_, media_flow, bwe_type, | 333 receivers.push_back(new PacketReceiver(&uplink_, media_flow, bwe_type, |
330 media_flow == 0, false, | 334 media_flow == 0, false, |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 sources.push_back(new AdaptiveVideoSource(static_cast<int>(i), 30, 300, 0, | 488 sources.push_back(new AdaptiveVideoSource(static_cast<int>(i), 30, 300, 0, |
485 i * kStartingApartMs)); | 489 i * kStartingApartMs)); |
486 senders.push_back(new VideoSender(&uplink_, sources[i], bwe_type)); | 490 senders.push_back(new VideoSender(&uplink_, sources[i], bwe_type)); |
487 } | 491 } |
488 | 492 |
489 FlowIds flow_ids = CreateFlowIdRange(0, static_cast<int>(num_flows - 1)); | 493 FlowIds flow_ids = CreateFlowIdRange(0, static_cast<int>(num_flows - 1)); |
490 | 494 |
491 DefaultEvaluationFilter up_filter(&uplink_, flow_ids); | 495 DefaultEvaluationFilter up_filter(&uplink_, flow_ids); |
492 LinkShare link_share(&(up_filter.choke)); | 496 LinkShare link_share(&(up_filter.choke)); |
493 | 497 |
494 RateCounterFilter total_utilization(&uplink_, flow_ids, "Total_utilization"); | 498 RateCounterFilter total_utilization(&uplink_, flow_ids, "Total_utilization", |
| 499 "Total_link_utilization"); |
495 | 500 |
496 // Delays is being plotted only for the first flow. | 501 // Delays is being plotted only for the first flow. |
497 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). | 502 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). |
498 for (size_t i = 0; i < num_flows; ++i) { | 503 for (size_t i = 0; i < num_flows; ++i) { |
499 metric_recorders.push_back(new MetricRecorder( | 504 metric_recorders.push_back(new MetricRecorder( |
500 bwe_names[bwe_type], static_cast<int>(i), senders[i], &link_share)); | 505 bwe_names[bwe_type], static_cast<int>(i), senders[i], &link_share)); |
501 | 506 |
502 receivers.push_back(new PacketReceiver(&uplink_, static_cast<int>(i), | 507 receivers.push_back(new PacketReceiver(&uplink_, static_cast<int>(i), |
503 bwe_type, i == 0, false, | 508 bwe_type, i == 0, false, |
504 metric_recorders[i])); | 509 metric_recorders[i])); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 LinkShare link_share(&choke_filter); | 680 LinkShare link_share(&choke_filter); |
676 | 681 |
677 JitterFilter jitter_filter(&uplink_, CreateFlowIds(kAllFlowIds, kNumFlows)); | 682 JitterFilter jitter_filter(&uplink_, CreateFlowIds(kAllFlowIds, kNumFlows)); |
678 | 683 |
679 rtc::scoped_ptr<DelayFilter> up_delay_filters[kNumFlows]; | 684 rtc::scoped_ptr<DelayFilter> up_delay_filters[kNumFlows]; |
680 for (size_t i = 0; i < kNumFlows; ++i) { | 685 for (size_t i = 0; i < kNumFlows; ++i) { |
681 up_delay_filters[i].reset(new DelayFilter(&uplink_, kAllFlowIds[i])); | 686 up_delay_filters[i].reset(new DelayFilter(&uplink_, kAllFlowIds[i])); |
682 } | 687 } |
683 | 688 |
684 RateCounterFilter total_utilization( | 689 RateCounterFilter total_utilization( |
685 &uplink_, CreateFlowIds(kAllFlowIds, kNumFlows), "Total_utilization"); | 690 &uplink_, CreateFlowIds(kAllFlowIds, kNumFlows), "Total_utilization", |
| 691 "Total_link_utilization"); |
686 | 692 |
687 // Delays is being plotted only for the first flow. | 693 // Delays is being plotted only for the first flow. |
688 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). | 694 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). |
689 rtc::scoped_ptr<PacketReceiver> receivers[kNumFlows]; | 695 rtc::scoped_ptr<PacketReceiver> receivers[kNumFlows]; |
690 for (size_t i = 0; i < kNumFlows; ++i) { | 696 for (size_t i = 0; i < kNumFlows; ++i) { |
691 metric_recorders[i].reset( | 697 metric_recorders[i].reset( |
692 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(i), | 698 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(i), |
693 senders[i].get(), &link_share)); | 699 senders[i].get(), &link_share)); |
694 | 700 |
695 receivers[i].reset(new PacketReceiver(&uplink_, kAllFlowIds[i], bwe_type, | 701 receivers[i].reset(new PacketReceiver(&uplink_, kAllFlowIds[i], bwe_type, |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 senders[id].reset(new TcpSender(&uplink_, static_cast<int>(id), | 796 senders[id].reset(new TcpSender(&uplink_, static_cast<int>(id), |
791 tcp_starting_times_ms[id - kNumRmcatFlows], | 797 tcp_starting_times_ms[id - kNumRmcatFlows], |
792 tcp_file_sizes_bytes[id - kNumRmcatFlows])); | 798 tcp_file_sizes_bytes[id - kNumRmcatFlows])); |
793 } | 799 } |
794 | 800 |
795 FlowIds flow_ids = CreateFlowIdRange(0, static_cast<int>(kNumTotalFlows - 1)); | 801 FlowIds flow_ids = CreateFlowIdRange(0, static_cast<int>(kNumTotalFlows - 1)); |
796 DefaultEvaluationFilter up_filter(&uplink_, flow_ids); | 802 DefaultEvaluationFilter up_filter(&uplink_, flow_ids); |
797 | 803 |
798 LinkShare link_share(&(up_filter.choke)); | 804 LinkShare link_share(&(up_filter.choke)); |
799 | 805 |
800 RateCounterFilter total_utilization(&uplink_, flow_ids, "Total_utilization"); | 806 RateCounterFilter total_utilization(&uplink_, flow_ids, "Total_utilization", |
| 807 "Total_link_utilization"); |
801 | 808 |
802 // Delays is being plotted only for the first flow. | 809 // Delays is being plotted only for the first flow. |
803 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). | 810 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). |
804 for (size_t id : kAllRmcatFlowIds) { | 811 for (size_t id : kAllRmcatFlowIds) { |
805 metric_recorders[id].reset( | 812 metric_recorders[id].reset( |
806 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(id), | 813 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(id), |
807 senders[id].get(), &link_share)); | 814 senders[id].get(), &link_share)); |
808 receivers[id].reset(new PacketReceiver(&uplink_, static_cast<int>(id), | 815 receivers[id].reset(new PacketReceiver(&uplink_, static_cast<int>(id), |
809 bwe_type, id == 0, false, | 816 bwe_type, id == 0, false, |
810 metric_recorders[id].get())); | 817 metric_recorders[id].get())); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 i * kStartingApartMs)); | 884 i * kStartingApartMs)); |
878 senders[i].reset(new VideoSender(&uplink_, sources[i].get(), bwe_type)); | 885 senders[i].reset(new VideoSender(&uplink_, sources[i].get(), bwe_type)); |
879 } | 886 } |
880 | 887 |
881 DefaultEvaluationFilter filter(&uplink_, | 888 DefaultEvaluationFilter filter(&uplink_, |
882 CreateFlowIds(kAllFlowIds, kNumFlows)); | 889 CreateFlowIds(kAllFlowIds, kNumFlows)); |
883 | 890 |
884 LinkShare link_share(&(filter.choke)); | 891 LinkShare link_share(&(filter.choke)); |
885 | 892 |
886 RateCounterFilter total_utilization( | 893 RateCounterFilter total_utilization( |
887 &uplink_, CreateFlowIds(kAllFlowIds, kNumFlows), "Total_utilization"); | 894 &uplink_, CreateFlowIds(kAllFlowIds, kNumFlows), "Total_utilization", |
| 895 "Total_link_utilization"); |
888 | 896 |
889 // Delays is being plotted only for the first flow. | 897 // Delays is being plotted only for the first flow. |
890 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). | 898 // To plot all of them, replace "i == 0" with "true" on new PacketReceiver(). |
891 for (size_t i = 0; i < kNumFlows; ++i) { | 899 for (size_t i = 0; i < kNumFlows; ++i) { |
892 metric_recorders[i].reset( | 900 metric_recorders[i].reset( |
893 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(i), | 901 new MetricRecorder(bwe_names[bwe_type], static_cast<int>(i), |
894 senders[i].get(), &link_share)); | 902 senders[i].get(), &link_share)); |
895 receivers[i].reset(new PacketReceiver(&uplink_, kAllFlowIds[i], bwe_type, | 903 receivers[i].reset(new PacketReceiver(&uplink_, kAllFlowIds[i], bwe_type, |
896 i == 0, false, | 904 i == 0, false, |
897 metric_recorders[i].get())); | 905 metric_recorders[i].get())); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 tcp_starting_times_ms.push_back( | 978 tcp_starting_times_ms.push_back( |
971 static_cast<int64_t>(random.Exponential(1.0f / kMeanMs))); | 979 static_cast<int64_t>(random.Exponential(1.0f / kMeanMs))); |
972 } | 980 } |
973 | 981 |
974 return tcp_starting_times_ms; | 982 return tcp_starting_times_ms; |
975 } | 983 } |
976 | 984 |
977 } // namespace bwe | 985 } // namespace bwe |
978 } // namespace testing | 986 } // namespace testing |
979 } // namespace webrtc | 987 } // namespace webrtc |
OLD | NEW |