OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
575 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_)) { | 575 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_)) { |
576 continue; | 576 continue; |
577 } | 577 } |
578 | 578 |
579 TimeSeries time_series(GetStreamName(stream_id), BAR_GRAPH); | 579 TimeSeries time_series(GetStreamName(stream_id), BAR_GRAPH); |
580 ProcessPoints<LoggedRtpPacket>( | 580 ProcessPoints<LoggedRtpPacket>( |
581 [](const LoggedRtpPacket& packet) -> rtc::Optional<float> { | 581 [](const LoggedRtpPacket& packet) -> rtc::Optional<float> { |
582 return rtc::Optional<float>(packet.total_length); | 582 return rtc::Optional<float>(packet.total_length); |
583 }, | 583 }, |
584 packet_stream, begin_time_, &time_series); | 584 packet_stream, begin_time_, &time_series); |
585 plot->series_list_.push_back(std::move(time_series)); | 585 plot->AppendTimeSeries(std::move(time_series)); |
586 } | 586 } |
587 | 587 |
588 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 588 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
589 plot->SetSuggestedYAxis(0, 1, "Packet size (bytes)", kBottomMargin, | 589 plot->SetSuggestedYAxis(0, 1, "Packet size (bytes)", kBottomMargin, |
590 kTopMargin); | 590 kTopMargin); |
591 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { | 591 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { |
592 plot->SetTitle("Incoming RTP packets"); | 592 plot->SetTitle("Incoming RTP packets"); |
593 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { | 593 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { |
594 plot->SetTitle("Outgoing RTP packets"); | 594 plot->SetTitle("Outgoing RTP packets"); |
595 } | 595 } |
(...skipping 15 matching lines...) Expand all Loading... | |
611 } | 611 } |
612 | 612 |
613 std::string label = label_prefix + " " + GetStreamName(stream_id); | 613 std::string label = label_prefix + " " + GetStreamName(stream_id); |
614 TimeSeries time_series(label, LINE_STEP_GRAPH); | 614 TimeSeries time_series(label, LINE_STEP_GRAPH); |
615 for (size_t i = 0; i < packet_stream.size(); i++) { | 615 for (size_t i = 0; i < packet_stream.size(); i++) { |
616 float x = static_cast<float>(packet_stream[i].timestamp - begin_time_) / | 616 float x = static_cast<float>(packet_stream[i].timestamp - begin_time_) / |
617 1000000; | 617 1000000; |
618 time_series.points.emplace_back(x, i + 1); | 618 time_series.points.emplace_back(x, i + 1); |
619 } | 619 } |
620 | 620 |
621 plot->series_list_.push_back(std::move(time_series)); | 621 plot->AppendTimeSeries(std::move(time_series)); |
622 } | 622 } |
623 } | 623 } |
624 | 624 |
625 void EventLogAnalyzer::CreateAccumulatedPacketsGraph( | 625 void EventLogAnalyzer::CreateAccumulatedPacketsGraph( |
626 PacketDirection desired_direction, | 626 PacketDirection desired_direction, |
627 Plot* plot) { | 627 Plot* plot) { |
628 CreateAccumulatedPacketsTimeSeries(desired_direction, plot, rtp_packets_, | 628 CreateAccumulatedPacketsTimeSeries(desired_direction, plot, rtp_packets_, |
629 "RTP"); | 629 "RTP"); |
630 CreateAccumulatedPacketsTimeSeries(desired_direction, plot, rtcp_packets_, | 630 CreateAccumulatedPacketsTimeSeries(desired_direction, plot, rtcp_packets_, |
631 "RTCP"); | 631 "RTCP"); |
(...skipping 30 matching lines...) Expand all Loading... | |
662 time_series[ssrc].points.push_back(TimeSeriesPoint(x, y)); | 662 time_series[ssrc].points.push_back(TimeSeriesPoint(x, y)); |
663 last_playout[ssrc] = timestamp; | 663 last_playout[ssrc] = timestamp; |
664 } | 664 } |
665 } | 665 } |
666 } | 666 } |
667 | 667 |
668 // Set labels and put in graph. | 668 // Set labels and put in graph. |
669 for (auto& kv : time_series) { | 669 for (auto& kv : time_series) { |
670 kv.second.label = SsrcToString(kv.first); | 670 kv.second.label = SsrcToString(kv.first); |
671 kv.second.style = BAR_GRAPH; | 671 kv.second.style = BAR_GRAPH; |
672 plot->series_list_.push_back(std::move(kv.second)); | 672 plot->AppendTimeSeries(std::move(kv.second)); |
673 } | 673 } |
674 | 674 |
675 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 675 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
676 plot->SetSuggestedYAxis(0, 1, "Time since last playout (ms)", kBottomMargin, | 676 plot->SetSuggestedYAxis(0, 1, "Time since last playout (ms)", kBottomMargin, |
677 kTopMargin); | 677 kTopMargin); |
678 plot->SetTitle("Audio playout"); | 678 plot->SetTitle("Audio playout"); |
679 } | 679 } |
680 | 680 |
681 // For audio SSRCs, plot the audio level. | 681 // For audio SSRCs, plot the audio level. |
682 void EventLogAnalyzer::CreateAudioLevelGraph(Plot* plot) { | 682 void EventLogAnalyzer::CreateAudioLevelGraph(Plot* plot) { |
(...skipping 12 matching lines...) Expand all Loading... | |
695 // Here we convert it to dBov. | 695 // Here we convert it to dBov. |
696 float y = static_cast<float>(-packet.header.extension.audioLevel); | 696 float y = static_cast<float>(-packet.header.extension.audioLevel); |
697 time_series[stream_id].points.emplace_back(TimeSeriesPoint(x, y)); | 697 time_series[stream_id].points.emplace_back(TimeSeriesPoint(x, y)); |
698 } | 698 } |
699 } | 699 } |
700 } | 700 } |
701 | 701 |
702 for (auto& series : time_series) { | 702 for (auto& series : time_series) { |
703 series.second.label = GetStreamName(series.first); | 703 series.second.label = GetStreamName(series.first); |
704 series.second.style = LINE_GRAPH; | 704 series.second.style = LINE_GRAPH; |
705 plot->series_list_.push_back(std::move(series.second)); | 705 plot->AppendTimeSeries(std::move(series.second)); |
706 } | 706 } |
707 | 707 |
708 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 708 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
709 plot->SetYAxis(-127, 0, "Audio level (dBov)", kBottomMargin, | 709 plot->SetYAxis(-127, 0, "Audio level (dBov)", kBottomMargin, |
710 kTopMargin); | 710 kTopMargin); |
711 plot->SetTitle("Audio level"); | 711 plot->SetTitle("Audio level"); |
712 } | 712 } |
713 | 713 |
714 // For each SSRC, plot the time between the consecutive playouts. | 714 // For each SSRC, plot the time between the consecutive playouts. |
715 void EventLogAnalyzer::CreateSequenceNumberGraph(Plot* plot) { | 715 void EventLogAnalyzer::CreateSequenceNumberGraph(Plot* plot) { |
716 for (auto& kv : rtp_packets_) { | 716 for (auto& kv : rtp_packets_) { |
717 StreamId stream_id = kv.first; | 717 StreamId stream_id = kv.first; |
718 const std::vector<LoggedRtpPacket>& packet_stream = kv.second; | 718 const std::vector<LoggedRtpPacket>& packet_stream = kv.second; |
719 // Filter on direction and SSRC. | 719 // Filter on direction and SSRC. |
720 if (stream_id.GetDirection() != kIncomingPacket || | 720 if (stream_id.GetDirection() != kIncomingPacket || |
721 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_)) { | 721 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_)) { |
722 continue; | 722 continue; |
723 } | 723 } |
724 | 724 |
725 TimeSeries time_series(GetStreamName(stream_id), BAR_GRAPH); | 725 TimeSeries time_series(GetStreamName(stream_id), BAR_GRAPH); |
726 ProcessPairs<LoggedRtpPacket, float>( | 726 ProcessPairs<LoggedRtpPacket, float>( |
727 [](const LoggedRtpPacket& old_packet, | 727 [](const LoggedRtpPacket& old_packet, |
728 const LoggedRtpPacket& new_packet) { | 728 const LoggedRtpPacket& new_packet) { |
729 int64_t diff = | 729 int64_t diff = |
730 WrappingDifference(new_packet.header.sequenceNumber, | 730 WrappingDifference(new_packet.header.sequenceNumber, |
731 old_packet.header.sequenceNumber, 1ul << 16); | 731 old_packet.header.sequenceNumber, 1ul << 16); |
732 return rtc::Optional<float>(diff); | 732 return rtc::Optional<float>(diff); |
733 }, | 733 }, |
734 packet_stream, begin_time_, &time_series); | 734 packet_stream, begin_time_, &time_series); |
735 plot->series_list_.push_back(std::move(time_series)); | 735 plot->AppendTimeSeries(std::move(time_series)); |
736 } | 736 } |
737 | 737 |
738 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 738 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
739 plot->SetSuggestedYAxis(0, 1, "Difference since last packet", kBottomMargin, | 739 plot->SetSuggestedYAxis(0, 1, "Difference since last packet", kBottomMargin, |
740 kTopMargin); | 740 kTopMargin); |
741 plot->SetTitle("Sequence number"); | 741 plot->SetTitle("Sequence number"); |
742 } | 742 } |
743 | 743 |
744 void EventLogAnalyzer::CreateIncomingPacketLossGraph(Plot* plot) { | 744 void EventLogAnalyzer::CreateIncomingPacketLossGraph(Plot* plot) { |
745 for (auto& kv : rtp_packets_) { | 745 for (auto& kv : rtp_packets_) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
782 } | 782 } |
783 float x = static_cast<float>(t - begin_time_) / 1000000; | 783 float x = static_cast<float>(t - begin_time_) / 1000000; |
784 int64_t expected_packets = highest_seq_number - highest_prior_seq_number; | 784 int64_t expected_packets = highest_seq_number - highest_prior_seq_number; |
785 if (expected_packets > 0) { | 785 if (expected_packets > 0) { |
786 int64_t received_packets = window_index_end - window_index_begin; | 786 int64_t received_packets = window_index_end - window_index_begin; |
787 int64_t lost_packets = expected_packets - received_packets; | 787 int64_t lost_packets = expected_packets - received_packets; |
788 float y = static_cast<float>(lost_packets) / expected_packets * 100; | 788 float y = static_cast<float>(lost_packets) / expected_packets * 100; |
789 time_series.points.emplace_back(x, y); | 789 time_series.points.emplace_back(x, y); |
790 } | 790 } |
791 } | 791 } |
792 plot->series_list_.push_back(std::move(time_series)); | 792 plot->AppendTimeSeries(std::move(time_series)); |
793 } | 793 } |
794 | 794 |
795 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 795 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
796 plot->SetSuggestedYAxis(0, 1, "Estimated loss rate (%)", kBottomMargin, | 796 plot->SetSuggestedYAxis(0, 1, "Estimated loss rate (%)", kBottomMargin, |
797 kTopMargin); | 797 kTopMargin); |
798 plot->SetTitle("Estimated incoming loss rate"); | 798 plot->SetTitle("Estimated incoming loss rate"); |
799 } | 799 } |
800 | 800 |
801 void EventLogAnalyzer::CreateDelayChangeGraph(Plot* plot) { | 801 void EventLogAnalyzer::CreateDelayChangeGraph(Plot* plot) { |
802 for (auto& kv : rtp_packets_) { | 802 for (auto& kv : rtp_packets_) { |
803 StreamId stream_id = kv.first; | 803 StreamId stream_id = kv.first; |
804 const std::vector<LoggedRtpPacket>& packet_stream = kv.second; | 804 const std::vector<LoggedRtpPacket>& packet_stream = kv.second; |
805 // Filter on direction and SSRC. | 805 // Filter on direction and SSRC. |
806 if (stream_id.GetDirection() != kIncomingPacket || | 806 if (stream_id.GetDirection() != kIncomingPacket || |
807 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_) || | 807 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_) || |
808 IsAudioSsrc(stream_id) || !IsVideoSsrc(stream_id) || | 808 IsAudioSsrc(stream_id) || !IsVideoSsrc(stream_id) || |
809 IsRtxSsrc(stream_id)) { | 809 IsRtxSsrc(stream_id)) { |
810 continue; | 810 continue; |
811 } | 811 } |
812 | 812 |
813 TimeSeries capture_time_data(GetStreamName(stream_id) + " capture-time", | 813 TimeSeries capture_time_data(GetStreamName(stream_id) + " capture-time", |
814 BAR_GRAPH); | 814 BAR_GRAPH); |
815 ProcessPairs<LoggedRtpPacket, double>(NetworkDelayDiff_CaptureTime, | 815 ProcessPairs<LoggedRtpPacket, double>(NetworkDelayDiff_CaptureTime, |
816 packet_stream, begin_time_, | 816 packet_stream, begin_time_, |
817 &capture_time_data); | 817 &capture_time_data); |
818 plot->series_list_.push_back(std::move(capture_time_data)); | 818 plot->AppendTimeSeries(std::move(capture_time_data)); |
819 | 819 |
820 TimeSeries send_time_data(GetStreamName(stream_id) + " abs-send-time", | 820 TimeSeries send_time_data(GetStreamName(stream_id) + " abs-send-time", |
821 BAR_GRAPH); | 821 BAR_GRAPH); |
822 ProcessPairs<LoggedRtpPacket, double>(NetworkDelayDiff_AbsSendTime, | 822 ProcessPairs<LoggedRtpPacket, double>(NetworkDelayDiff_AbsSendTime, |
823 packet_stream, begin_time_, | 823 packet_stream, begin_time_, |
824 &send_time_data); | 824 &send_time_data); |
825 plot->series_list_.push_back(std::move(send_time_data)); | 825 plot->AppendTimeSeries(std::move(send_time_data)); |
826 } | 826 } |
827 | 827 |
828 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 828 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
829 plot->SetSuggestedYAxis(0, 1, "Latency change (ms)", kBottomMargin, | 829 plot->SetSuggestedYAxis(0, 1, "Latency change (ms)", kBottomMargin, |
830 kTopMargin); | 830 kTopMargin); |
831 plot->SetTitle("Network latency change between consecutive packets"); | 831 plot->SetTitle("Network latency change between consecutive packets"); |
832 } | 832 } |
833 | 833 |
834 void EventLogAnalyzer::CreateAccumulatedDelayChangeGraph(Plot* plot) { | 834 void EventLogAnalyzer::CreateAccumulatedDelayChangeGraph(Plot* plot) { |
835 for (auto& kv : rtp_packets_) { | 835 for (auto& kv : rtp_packets_) { |
836 StreamId stream_id = kv.first; | 836 StreamId stream_id = kv.first; |
837 const std::vector<LoggedRtpPacket>& packet_stream = kv.second; | 837 const std::vector<LoggedRtpPacket>& packet_stream = kv.second; |
838 // Filter on direction and SSRC. | 838 // Filter on direction and SSRC. |
839 if (stream_id.GetDirection() != kIncomingPacket || | 839 if (stream_id.GetDirection() != kIncomingPacket || |
840 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_) || | 840 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_) || |
841 IsAudioSsrc(stream_id) || !IsVideoSsrc(stream_id) || | 841 IsAudioSsrc(stream_id) || !IsVideoSsrc(stream_id) || |
842 IsRtxSsrc(stream_id)) { | 842 IsRtxSsrc(stream_id)) { |
843 continue; | 843 continue; |
844 } | 844 } |
845 | 845 |
846 TimeSeries capture_time_data(GetStreamName(stream_id) + " capture-time", | 846 TimeSeries capture_time_data(GetStreamName(stream_id) + " capture-time", |
847 LINE_GRAPH); | 847 LINE_GRAPH); |
848 AccumulatePairs<LoggedRtpPacket, double>(NetworkDelayDiff_CaptureTime, | 848 AccumulatePairs<LoggedRtpPacket, double>(NetworkDelayDiff_CaptureTime, |
849 packet_stream, begin_time_, | 849 packet_stream, begin_time_, |
850 &capture_time_data); | 850 &capture_time_data); |
851 plot->series_list_.push_back(std::move(capture_time_data)); | 851 plot->AppendTimeSeries(std::move(capture_time_data)); |
852 | 852 |
853 TimeSeries send_time_data(GetStreamName(stream_id) + " abs-send-time", | 853 TimeSeries send_time_data(GetStreamName(stream_id) + " abs-send-time", |
854 LINE_GRAPH); | 854 LINE_GRAPH); |
855 AccumulatePairs<LoggedRtpPacket, double>(NetworkDelayDiff_AbsSendTime, | 855 AccumulatePairs<LoggedRtpPacket, double>(NetworkDelayDiff_AbsSendTime, |
856 packet_stream, begin_time_, | 856 packet_stream, begin_time_, |
857 &send_time_data); | 857 &send_time_data); |
858 plot->series_list_.push_back(std::move(send_time_data)); | 858 plot->AppendTimeSeries(std::move(send_time_data)); |
859 } | 859 } |
860 | 860 |
861 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 861 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
862 plot->SetSuggestedYAxis(0, 1, "Latency change (ms)", kBottomMargin, | 862 plot->SetSuggestedYAxis(0, 1, "Latency change (ms)", kBottomMargin, |
863 kTopMargin); | 863 kTopMargin); |
864 plot->SetTitle("Accumulated network latency change"); | 864 plot->SetTitle("Accumulated network latency change"); |
865 } | 865 } |
866 | 866 |
867 // Plot the fraction of packets lost (as perceived by the loss-based BWE). | 867 // Plot the fraction of packets lost (as perceived by the loss-based BWE). |
868 void EventLogAnalyzer::CreateFractionLossGraph(Plot* plot) { | 868 void EventLogAnalyzer::CreateFractionLossGraph(Plot* plot) { |
869 TimeSeries* time_series = | 869 TimeSeries time_series = TimeSeries("Fraction lost", LINE_DOT_GRAPH); |
terelius
2017/04/18 16:17:54
TimeSeries time_series("Fraction lost", LINE_DOT_G
philipel
2017/04/19 08:59:37
Done.
| |
870 plot->AddTimeSeries("Fraction lost", LINE_DOT_GRAPH); | |
871 for (auto& bwe_update : bwe_loss_updates_) { | 870 for (auto& bwe_update : bwe_loss_updates_) { |
872 float x = static_cast<float>(bwe_update.timestamp - begin_time_) / 1000000; | 871 float x = static_cast<float>(bwe_update.timestamp - begin_time_) / 1000000; |
873 float y = static_cast<float>(bwe_update.fraction_loss) / 255 * 100; | 872 float y = static_cast<float>(bwe_update.fraction_loss) / 255 * 100; |
874 time_series->points.emplace_back(x, y); | 873 time_series.points.emplace_back(x, y); |
875 } | 874 } |
876 | 875 |
877 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 876 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
878 plot->SetSuggestedYAxis(0, 10, "Percent lost packets", kBottomMargin, | 877 plot->SetSuggestedYAxis(0, 10, "Percent lost packets", kBottomMargin, |
879 kTopMargin); | 878 kTopMargin); |
880 plot->SetTitle("Reported packet loss"); | 879 plot->SetTitle("Reported packet loss"); |
880 plot->AppendTimeSeries(std::move(time_series)); | |
881 } | 881 } |
882 | 882 |
883 // Plot the total bandwidth used by all RTP streams. | 883 // Plot the total bandwidth used by all RTP streams. |
884 void EventLogAnalyzer::CreateTotalBitrateGraph( | 884 void EventLogAnalyzer::CreateTotalBitrateGraph( |
885 PacketDirection desired_direction, | 885 PacketDirection desired_direction, |
886 Plot* plot) { | 886 Plot* plot) { |
887 struct TimestampSize { | 887 struct TimestampSize { |
888 TimestampSize(uint64_t t, size_t s) : timestamp(t), size(s) {} | 888 TimestampSize(uint64_t t, size_t s) : timestamp(t), size(s) {} |
889 uint64_t timestamp; | 889 uint64_t timestamp; |
890 size_t size; | 890 size_t size; |
(...skipping 14 matching lines...) Expand all Loading... | |
905 packets.push_back(TimestampSize(timestamp, total_length)); | 905 packets.push_back(TimestampSize(timestamp, total_length)); |
906 } | 906 } |
907 } | 907 } |
908 } | 908 } |
909 | 909 |
910 size_t window_index_begin = 0; | 910 size_t window_index_begin = 0; |
911 size_t window_index_end = 0; | 911 size_t window_index_end = 0; |
912 size_t bytes_in_window = 0; | 912 size_t bytes_in_window = 0; |
913 | 913 |
914 // Calculate a moving average of the bitrate and store in a TimeSeries. | 914 // Calculate a moving average of the bitrate and store in a TimeSeries. |
915 TimeSeries* time_series = plot->AddTimeSeries("Bitrate", LINE_GRAPH); | 915 TimeSeries bitrate_series = TimeSeries("Bitrate", LINE_GRAPH); |
916 for (uint64_t time = begin_time_; time < end_time_ + step_; time += step_) { | 916 for (uint64_t time = begin_time_; time < end_time_ + step_; time += step_) { |
917 while (window_index_end < packets.size() && | 917 while (window_index_end < packets.size() && |
918 packets[window_index_end].timestamp < time) { | 918 packets[window_index_end].timestamp < time) { |
919 bytes_in_window += packets[window_index_end].size; | 919 bytes_in_window += packets[window_index_end].size; |
920 ++window_index_end; | 920 ++window_index_end; |
921 } | 921 } |
922 while (window_index_begin < packets.size() && | 922 while (window_index_begin < packets.size() && |
923 packets[window_index_begin].timestamp < time - window_duration_) { | 923 packets[window_index_begin].timestamp < time - window_duration_) { |
924 RTC_DCHECK_LE(packets[window_index_begin].size, bytes_in_window); | 924 RTC_DCHECK_LE(packets[window_index_begin].size, bytes_in_window); |
925 bytes_in_window -= packets[window_index_begin].size; | 925 bytes_in_window -= packets[window_index_begin].size; |
926 ++window_index_begin; | 926 ++window_index_begin; |
927 } | 927 } |
928 float window_duration_in_seconds = | 928 float window_duration_in_seconds = |
929 static_cast<float>(window_duration_) / 1000000; | 929 static_cast<float>(window_duration_) / 1000000; |
930 float x = static_cast<float>(time - begin_time_) / 1000000; | 930 float x = static_cast<float>(time - begin_time_) / 1000000; |
931 float y = bytes_in_window * 8 / window_duration_in_seconds / 1000; | 931 float y = bytes_in_window * 8 / window_duration_in_seconds / 1000; |
932 time_series->points.emplace_back(x, y); | 932 bitrate_series.points.emplace_back(x, y); |
933 } | 933 } |
934 plot->AppendTimeSeries(std::move(bitrate_series)); | |
934 | 935 |
935 // Overlay the send-side bandwidth estimate over the outgoing bitrate. | 936 // Overlay the send-side bandwidth estimate over the outgoing bitrate. |
936 if (desired_direction == kOutgoingPacket) { | 937 if (desired_direction == kOutgoingPacket) { |
937 TimeSeries* loss_series = | 938 TimeSeries loss_series = TimeSeries("Loss-based estimate", LINE_STEP_GRAPH); |
terelius
2017/04/18 16:17:54
Avoid extra copy.
philipel
2017/04/19 08:59:37
Done.
| |
938 plot->AddTimeSeries("Loss-based estimate", LINE_STEP_GRAPH); | |
939 for (auto& loss_update : bwe_loss_updates_) { | 939 for (auto& loss_update : bwe_loss_updates_) { |
940 float x = | 940 float x = |
941 static_cast<float>(loss_update.timestamp - begin_time_) / 1000000; | 941 static_cast<float>(loss_update.timestamp - begin_time_) / 1000000; |
942 float y = static_cast<float>(loss_update.new_bitrate) / 1000; | 942 float y = static_cast<float>(loss_update.new_bitrate) / 1000; |
943 loss_series->points.emplace_back(x, y); | 943 loss_series.points.emplace_back(x, y); |
944 } | 944 } |
945 | 945 |
946 TimeSeries* delay_series = | 946 TimeSeries delay_series = |
947 plot->AddTimeSeries("Delay-based estimate", LINE_STEP_GRAPH); | 947 TimeSeries("Delay-based estimate", LINE_STEP_GRAPH); |
terelius
2017/04/18 16:17:54
Avoid extra copy.
philipel
2017/04/19 08:59:37
Done.
| |
948 for (auto& delay_update : bwe_delay_updates_) { | 948 for (auto& delay_update : bwe_delay_updates_) { |
949 float x = | 949 float x = |
950 static_cast<float>(delay_update.timestamp - begin_time_) / 1000000; | 950 static_cast<float>(delay_update.timestamp - begin_time_) / 1000000; |
951 float y = static_cast<float>(delay_update.bitrate_bps) / 1000; | 951 float y = static_cast<float>(delay_update.bitrate_bps) / 1000; |
952 delay_series->points.emplace_back(x, y); | 952 delay_series.points.emplace_back(x, y); |
953 } | 953 } |
954 | 954 |
955 TimeSeries* created_series = | 955 TimeSeries created_series = TimeSeries("Probe cluster created.", DOT_GRAPH); |
terelius
2017/04/18 16:17:54
Avoid extra copy.
philipel
2017/04/19 08:59:37
Done.
| |
956 plot->AddTimeSeries("Probe cluster created.", DOT_GRAPH); | |
957 for (auto& cluster : bwe_probe_cluster_created_events_) { | 956 for (auto& cluster : bwe_probe_cluster_created_events_) { |
958 float x = static_cast<float>(cluster.timestamp - begin_time_) / 1000000; | 957 float x = static_cast<float>(cluster.timestamp - begin_time_) / 1000000; |
959 float y = static_cast<float>(cluster.bitrate_bps) / 1000; | 958 float y = static_cast<float>(cluster.bitrate_bps) / 1000; |
960 created_series->points.emplace_back(x, y); | 959 created_series.points.emplace_back(x, y); |
961 } | 960 } |
962 | 961 |
963 TimeSeries* result_series = | 962 TimeSeries result_series = TimeSeries("Probing results.", DOT_GRAPH); |
terelius
2017/04/18 16:17:54
Avoid extra copy.
philipel
2017/04/19 08:59:37
Done.
| |
964 plot->AddTimeSeries("Probing results.", DOT_GRAPH); | |
965 for (auto& result : bwe_probe_result_events_) { | 963 for (auto& result : bwe_probe_result_events_) { |
966 if (result.bitrate_bps) { | 964 if (result.bitrate_bps) { |
967 float x = static_cast<float>(result.timestamp - begin_time_) / 1000000; | 965 float x = static_cast<float>(result.timestamp - begin_time_) / 1000000; |
968 float y = static_cast<float>(*result.bitrate_bps) / 1000; | 966 float y = static_cast<float>(*result.bitrate_bps) / 1000; |
969 result_series->points.emplace_back(x, y); | 967 result_series.points.emplace_back(x, y); |
970 } | 968 } |
971 } | 969 } |
970 | |
971 plot->AppendTimeSeries(std::move(loss_series)); | |
972 plot->AppendTimeSeries(std::move(delay_series)); | |
973 plot->AppendTimeSeries(std::move(created_series)); | |
974 plot->AppendTimeSeries(std::move(result_series)); | |
972 } | 975 } |
973 | 976 |
974 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 977 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
975 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin); | 978 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin); |
976 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { | 979 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { |
977 plot->SetTitle("Incoming RTP bitrate"); | 980 plot->SetTitle("Incoming RTP bitrate"); |
978 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { | 981 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { |
979 plot->SetTitle("Outgoing RTP bitrate"); | 982 plot->SetTitle("Outgoing RTP bitrate"); |
980 } | 983 } |
981 } | 984 } |
(...skipping 11 matching lines...) Expand all Loading... | |
993 continue; | 996 continue; |
994 } | 997 } |
995 | 998 |
996 TimeSeries time_series(GetStreamName(stream_id), LINE_GRAPH); | 999 TimeSeries time_series(GetStreamName(stream_id), LINE_GRAPH); |
997 MovingAverage<LoggedRtpPacket, double>( | 1000 MovingAverage<LoggedRtpPacket, double>( |
998 [](const LoggedRtpPacket& packet) { | 1001 [](const LoggedRtpPacket& packet) { |
999 return rtc::Optional<double>(packet.total_length * 8.0 / 1000.0); | 1002 return rtc::Optional<double>(packet.total_length * 8.0 / 1000.0); |
1000 }, | 1003 }, |
1001 packet_stream, begin_time_, end_time_, window_duration_, step_, | 1004 packet_stream, begin_time_, end_time_, window_duration_, step_, |
1002 &time_series); | 1005 &time_series); |
1003 plot->series_list_.push_back(std::move(time_series)); | 1006 plot->AppendTimeSeries(std::move(time_series)); |
1004 } | 1007 } |
1005 | 1008 |
1006 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 1009 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
1007 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin); | 1010 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin); |
1008 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { | 1011 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { |
1009 plot->SetTitle("Incoming bitrate per stream"); | 1012 plot->SetTitle("Incoming bitrate per stream"); |
1010 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { | 1013 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { |
1011 plot->SetTitle("Outgoing bitrate per stream"); | 1014 plot->SetTitle("Outgoing bitrate per stream"); |
1012 } | 1015 } |
1013 } | 1016 } |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1119 time_us - last_update_us >= 1e6) { | 1122 time_us - last_update_us >= 1e6) { |
1120 uint32_t y = observer.last_bitrate_bps() / 1000; | 1123 uint32_t y = observer.last_bitrate_bps() / 1000; |
1121 float x = static_cast<float>(clock.TimeInMicroseconds() - begin_time_) / | 1124 float x = static_cast<float>(clock.TimeInMicroseconds() - begin_time_) / |
1122 1000000; | 1125 1000000; |
1123 time_series.points.emplace_back(x, y); | 1126 time_series.points.emplace_back(x, y); |
1124 last_update_us = time_us; | 1127 last_update_us = time_us; |
1125 } | 1128 } |
1126 time_us = std::min({NextRtpTime(), NextRtcpTime(), NextProcessTime()}); | 1129 time_us = std::min({NextRtpTime(), NextRtcpTime(), NextProcessTime()}); |
1127 } | 1130 } |
1128 // Add the data set to the plot. | 1131 // Add the data set to the plot. |
1129 plot->series_list_.push_back(std::move(time_series)); | 1132 plot->AppendTimeSeries(std::move(time_series)); |
1130 plot->series_list_.push_back(std::move(acked_time_series)); | 1133 plot->AppendTimeSeries(std::move(acked_time_series)); |
1131 | 1134 |
1132 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 1135 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
1133 plot->SetSuggestedYAxis(0, 10, "Bitrate (kbps)", kBottomMargin, kTopMargin); | 1136 plot->SetSuggestedYAxis(0, 10, "Bitrate (kbps)", kBottomMargin, kTopMargin); |
1134 plot->SetTitle("Simulated BWE behavior"); | 1137 plot->SetTitle("Simulated BWE behavior"); |
1135 } | 1138 } |
1136 | 1139 |
1137 void EventLogAnalyzer::CreateNetworkDelayFeedbackGraph(Plot* plot) { | 1140 void EventLogAnalyzer::CreateNetworkDelayFeedbackGraph(Plot* plot) { |
1138 std::map<uint64_t, const LoggedRtpPacket*> outgoing_rtp; | 1141 std::map<uint64_t, const LoggedRtpPacket*> outgoing_rtp; |
1139 std::map<uint64_t, const LoggedRtcpPacket*> incoming_rtcp; | 1142 std::map<uint64_t, const LoggedRtcpPacket*> incoming_rtcp; |
1140 | 1143 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1210 } | 1213 } |
1211 ++rtp_iterator; | 1214 ++rtp_iterator; |
1212 } | 1215 } |
1213 time_us = std::min(NextRtpTime(), NextRtcpTime()); | 1216 time_us = std::min(NextRtpTime(), NextRtcpTime()); |
1214 } | 1217 } |
1215 // We assume that the base network delay (w/o queues) is the min delay | 1218 // We assume that the base network delay (w/o queues) is the min delay |
1216 // observed during the call. | 1219 // observed during the call. |
1217 for (TimeSeriesPoint& point : time_series.points) | 1220 for (TimeSeriesPoint& point : time_series.points) |
1218 point.y -= estimated_base_delay_ms; | 1221 point.y -= estimated_base_delay_ms; |
1219 // Add the data set to the plot. | 1222 // Add the data set to the plot. |
1220 plot->series_list_.push_back(std::move(time_series)); | 1223 plot->AppendTimeSeries(std::move(time_series)); |
1221 | 1224 |
1222 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 1225 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
1223 plot->SetSuggestedYAxis(0, 10, "Delay (ms)", kBottomMargin, kTopMargin); | 1226 plot->SetSuggestedYAxis(0, 10, "Delay (ms)", kBottomMargin, kTopMargin); |
1224 plot->SetTitle("Network Delay Change."); | 1227 plot->SetTitle("Network Delay Change."); |
1225 } | 1228 } |
1226 | 1229 |
1227 std::vector<std::pair<int64_t, int64_t>> EventLogAnalyzer::GetFrameTimestamps() | 1230 std::vector<std::pair<int64_t, int64_t>> EventLogAnalyzer::GetFrameTimestamps() |
1228 const { | 1231 const { |
1229 std::vector<std::pair<int64_t, int64_t>> timestamps; | 1232 std::vector<std::pair<int64_t, int64_t>> timestamps; |
1230 size_t largest_stream_size = 0; | 1233 size_t largest_stream_size = 0; |
(...skipping 27 matching lines...) Expand all Loading... | |
1258 StreamId stream_id = kv.first; | 1261 StreamId stream_id = kv.first; |
1259 | 1262 |
1260 { | 1263 { |
1261 TimeSeries timestamp_data(GetStreamName(stream_id) + " capture-time", | 1264 TimeSeries timestamp_data(GetStreamName(stream_id) + " capture-time", |
1262 LINE_DOT_GRAPH); | 1265 LINE_DOT_GRAPH); |
1263 for (LoggedRtpPacket packet : rtp_packets) { | 1266 for (LoggedRtpPacket packet : rtp_packets) { |
1264 float x = static_cast<float>(packet.timestamp - begin_time_) / 1000000; | 1267 float x = static_cast<float>(packet.timestamp - begin_time_) / 1000000; |
1265 float y = packet.header.timestamp; | 1268 float y = packet.header.timestamp; |
1266 timestamp_data.points.emplace_back(x, y); | 1269 timestamp_data.points.emplace_back(x, y); |
1267 } | 1270 } |
1268 plot->series_list_.push_back(std::move(timestamp_data)); | 1271 plot->AppendTimeSeries(std::move(timestamp_data)); |
1269 } | 1272 } |
1270 | 1273 |
1271 { | 1274 { |
1272 auto kv = rtcp_packets_.find(stream_id); | 1275 auto kv = rtcp_packets_.find(stream_id); |
1273 if (kv != rtcp_packets_.end()) { | 1276 if (kv != rtcp_packets_.end()) { |
1274 const auto& packets = kv->second; | 1277 const auto& packets = kv->second; |
1275 TimeSeries timestamp_data( | 1278 TimeSeries timestamp_data( |
1276 GetStreamName(stream_id) + " rtcp capture-time", LINE_DOT_GRAPH); | 1279 GetStreamName(stream_id) + " rtcp capture-time", LINE_DOT_GRAPH); |
1277 for (const LoggedRtcpPacket& rtcp : packets) { | 1280 for (const LoggedRtcpPacket& rtcp : packets) { |
1278 if (rtcp.type != kRtcpSr) | 1281 if (rtcp.type != kRtcpSr) |
1279 continue; | 1282 continue; |
1280 rtcp::SenderReport* sr; | 1283 rtcp::SenderReport* sr; |
1281 sr = static_cast<rtcp::SenderReport*>(rtcp.packet.get()); | 1284 sr = static_cast<rtcp::SenderReport*>(rtcp.packet.get()); |
1282 float x = static_cast<float>(rtcp.timestamp - begin_time_) / 1000000; | 1285 float x = static_cast<float>(rtcp.timestamp - begin_time_) / 1000000; |
1283 float y = sr->rtp_timestamp(); | 1286 float y = sr->rtp_timestamp(); |
1284 timestamp_data.points.emplace_back(x, y); | 1287 timestamp_data.points.emplace_back(x, y); |
1285 } | 1288 } |
1286 plot->series_list_.push_back(std::move(timestamp_data)); | 1289 plot->AppendTimeSeries(std::move(timestamp_data)); |
1287 } | 1290 } |
1288 } | 1291 } |
1289 } | 1292 } |
1290 | 1293 |
1291 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 1294 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
1292 plot->SetSuggestedYAxis(0, 1, "Timestamp (90khz)", kBottomMargin, kTopMargin); | 1295 plot->SetSuggestedYAxis(0, 1, "Timestamp (90khz)", kBottomMargin, kTopMargin); |
1293 plot->SetTitle("Timestamps"); | 1296 plot->SetTitle("Timestamps"); |
1294 } | 1297 } |
1295 | 1298 |
1296 void EventLogAnalyzer::CreateAudioEncoderTargetBitrateGraph(Plot* plot) { | 1299 void EventLogAnalyzer::CreateAudioEncoderTargetBitrateGraph(Plot* plot) { |
1297 TimeSeries* time_series = | 1300 TimeSeries time_series = |
1298 plot->AddTimeSeries("Audio encoder target bitrate", LINE_DOT_GRAPH); | 1301 TimeSeries("Audio encoder target bitrate", LINE_DOT_GRAPH); |
terelius
2017/04/18 16:17:54
Avoid extra copy.
philipel
2017/04/19 08:59:37
Done.
| |
1299 ProcessPoints<AudioNetworkAdaptationEvent>( | 1302 ProcessPoints<AudioNetworkAdaptationEvent>( |
1300 [](const AudioNetworkAdaptationEvent& ana_event) -> rtc::Optional<float> { | 1303 [](const AudioNetworkAdaptationEvent& ana_event) -> rtc::Optional<float> { |
1301 if (ana_event.config.bitrate_bps) | 1304 if (ana_event.config.bitrate_bps) |
1302 return rtc::Optional<float>( | 1305 return rtc::Optional<float>( |
1303 static_cast<float>(*ana_event.config.bitrate_bps)); | 1306 static_cast<float>(*ana_event.config.bitrate_bps)); |
1304 return rtc::Optional<float>(); | 1307 return rtc::Optional<float>(); |
1305 }, | 1308 }, |
1306 audio_network_adaptation_events_, begin_time_, time_series); | 1309 audio_network_adaptation_events_, begin_time_, &time_series); |
1307 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 1310 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
1308 plot->SetSuggestedYAxis(0, 1, "Bitrate (bps)", kBottomMargin, kTopMargin); | 1311 plot->SetSuggestedYAxis(0, 1, "Bitrate (bps)", kBottomMargin, kTopMargin); |
1309 plot->SetTitle("Reported audio encoder target bitrate"); | 1312 plot->SetTitle("Reported audio encoder target bitrate"); |
1313 plot->AppendTimeSeries(std::move(time_series)); | |
1310 } | 1314 } |
1311 | 1315 |
1312 void EventLogAnalyzer::CreateAudioEncoderFrameLengthGraph(Plot* plot) { | 1316 void EventLogAnalyzer::CreateAudioEncoderFrameLengthGraph(Plot* plot) { |
1313 TimeSeries* time_series = | 1317 TimeSeries time_series = |
terelius
2017/04/18 16:17:54
Avoid extra copy.
philipel
2017/04/19 08:59:37
Done.
| |
1314 plot->AddTimeSeries("Audio encoder frame length", LINE_DOT_GRAPH); | 1318 TimeSeries("Audio encoder frame length", LINE_DOT_GRAPH); |
1315 ProcessPoints<AudioNetworkAdaptationEvent>( | 1319 ProcessPoints<AudioNetworkAdaptationEvent>( |
1316 [](const AudioNetworkAdaptationEvent& ana_event) { | 1320 [](const AudioNetworkAdaptationEvent& ana_event) { |
1317 if (ana_event.config.frame_length_ms) | 1321 if (ana_event.config.frame_length_ms) |
1318 return rtc::Optional<float>( | 1322 return rtc::Optional<float>( |
1319 static_cast<float>(*ana_event.config.frame_length_ms)); | 1323 static_cast<float>(*ana_event.config.frame_length_ms)); |
1320 return rtc::Optional<float>(); | 1324 return rtc::Optional<float>(); |
1321 }, | 1325 }, |
1322 audio_network_adaptation_events_, begin_time_, time_series); | 1326 audio_network_adaptation_events_, begin_time_, &time_series); |
1323 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 1327 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
1324 plot->SetSuggestedYAxis(0, 1, "Frame length (ms)", kBottomMargin, kTopMargin); | 1328 plot->SetSuggestedYAxis(0, 1, "Frame length (ms)", kBottomMargin, kTopMargin); |
1325 plot->SetTitle("Reported audio encoder frame length"); | 1329 plot->SetTitle("Reported audio encoder frame length"); |
1330 plot->AppendTimeSeries(std::move(time_series)); | |
1326 } | 1331 } |
1327 | 1332 |
1328 void EventLogAnalyzer::CreateAudioEncoderUplinkPacketLossFractionGraph( | 1333 void EventLogAnalyzer::CreateAudioEncoderUplinkPacketLossFractionGraph( |
1329 Plot* plot) { | 1334 Plot* plot) { |
1330 TimeSeries* time_series = plot->AddTimeSeries( | 1335 TimeSeries time_series = |
1331 "Audio encoder uplink packet loss fraction", LINE_DOT_GRAPH); | 1336 TimeSeries("Audio encoder uplink packet loss fraction", LINE_DOT_GRAPH); |
terelius
2017/04/18 16:17:54
Avoid extra copy.
philipel
2017/04/19 08:59:37
Done.
| |
1332 ProcessPoints<AudioNetworkAdaptationEvent>( | 1337 ProcessPoints<AudioNetworkAdaptationEvent>( |
1333 [](const AudioNetworkAdaptationEvent& ana_event) { | 1338 [](const AudioNetworkAdaptationEvent& ana_event) { |
1334 if (ana_event.config.uplink_packet_loss_fraction) | 1339 if (ana_event.config.uplink_packet_loss_fraction) |
1335 return rtc::Optional<float>(static_cast<float>( | 1340 return rtc::Optional<float>(static_cast<float>( |
1336 *ana_event.config.uplink_packet_loss_fraction)); | 1341 *ana_event.config.uplink_packet_loss_fraction)); |
1337 return rtc::Optional<float>(); | 1342 return rtc::Optional<float>(); |
1338 }, | 1343 }, |
1339 audio_network_adaptation_events_, begin_time_, time_series); | 1344 audio_network_adaptation_events_, begin_time_, &time_series); |
1340 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 1345 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
1341 plot->SetSuggestedYAxis(0, 10, "Percent lost packets", kBottomMargin, | 1346 plot->SetSuggestedYAxis(0, 10, "Percent lost packets", kBottomMargin, |
1342 kTopMargin); | 1347 kTopMargin); |
1343 plot->SetTitle("Reported audio encoder lost packets"); | 1348 plot->SetTitle("Reported audio encoder lost packets"); |
1349 plot->AppendTimeSeries(std::move(time_series)); | |
1344 } | 1350 } |
1345 | 1351 |
1346 void EventLogAnalyzer::CreateAudioEncoderEnableFecGraph(Plot* plot) { | 1352 void EventLogAnalyzer::CreateAudioEncoderEnableFecGraph(Plot* plot) { |
1347 TimeSeries* time_series = | 1353 TimeSeries time_series = TimeSeries("Audio encoder FEC", LINE_DOT_GRAPH); |
terelius
2017/04/18 16:17:54
Avoid extra copy.
philipel
2017/04/19 08:59:37
Done.
| |
1348 plot->AddTimeSeries("Audio encoder FEC", LINE_DOT_GRAPH); | |
1349 ProcessPoints<AudioNetworkAdaptationEvent>( | 1354 ProcessPoints<AudioNetworkAdaptationEvent>( |
1350 [](const AudioNetworkAdaptationEvent& ana_event) { | 1355 [](const AudioNetworkAdaptationEvent& ana_event) { |
1351 if (ana_event.config.enable_fec) | 1356 if (ana_event.config.enable_fec) |
1352 return rtc::Optional<float>( | 1357 return rtc::Optional<float>( |
1353 static_cast<float>(*ana_event.config.enable_fec)); | 1358 static_cast<float>(*ana_event.config.enable_fec)); |
1354 return rtc::Optional<float>(); | 1359 return rtc::Optional<float>(); |
1355 }, | 1360 }, |
1356 audio_network_adaptation_events_, begin_time_, time_series); | 1361 audio_network_adaptation_events_, begin_time_, &time_series); |
1357 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 1362 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
1358 plot->SetSuggestedYAxis(0, 1, "FEC (false/true)", kBottomMargin, kTopMargin); | 1363 plot->SetSuggestedYAxis(0, 1, "FEC (false/true)", kBottomMargin, kTopMargin); |
1359 plot->SetTitle("Reported audio encoder FEC"); | 1364 plot->SetTitle("Reported audio encoder FEC"); |
1365 plot->AppendTimeSeries(std::move(time_series)); | |
1360 } | 1366 } |
1361 | 1367 |
1362 void EventLogAnalyzer::CreateAudioEncoderEnableDtxGraph(Plot* plot) { | 1368 void EventLogAnalyzer::CreateAudioEncoderEnableDtxGraph(Plot* plot) { |
1363 TimeSeries* time_series = | 1369 TimeSeries time_series = TimeSeries("Audio encoder DTX", LINE_DOT_GRAPH); |
terelius
2017/04/18 16:17:54
Avoid extra copy.
philipel
2017/04/19 08:59:37
Done.
| |
1364 plot->AddTimeSeries("Audio encoder DTX", LINE_DOT_GRAPH); | |
1365 ProcessPoints<AudioNetworkAdaptationEvent>( | 1370 ProcessPoints<AudioNetworkAdaptationEvent>( |
1366 [](const AudioNetworkAdaptationEvent& ana_event) { | 1371 [](const AudioNetworkAdaptationEvent& ana_event) { |
1367 if (ana_event.config.enable_dtx) | 1372 if (ana_event.config.enable_dtx) |
1368 return rtc::Optional<float>( | 1373 return rtc::Optional<float>( |
1369 static_cast<float>(*ana_event.config.enable_dtx)); | 1374 static_cast<float>(*ana_event.config.enable_dtx)); |
1370 return rtc::Optional<float>(); | 1375 return rtc::Optional<float>(); |
1371 }, | 1376 }, |
1372 audio_network_adaptation_events_, begin_time_, time_series); | 1377 audio_network_adaptation_events_, begin_time_, &time_series); |
1373 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 1378 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
1374 plot->SetSuggestedYAxis(0, 1, "DTX (false/true)", kBottomMargin, kTopMargin); | 1379 plot->SetSuggestedYAxis(0, 1, "DTX (false/true)", kBottomMargin, kTopMargin); |
1375 plot->SetTitle("Reported audio encoder DTX"); | 1380 plot->SetTitle("Reported audio encoder DTX"); |
1381 plot->AppendTimeSeries(std::move(time_series)); | |
1376 } | 1382 } |
1377 | 1383 |
1378 void EventLogAnalyzer::CreateAudioEncoderNumChannelsGraph(Plot* plot) { | 1384 void EventLogAnalyzer::CreateAudioEncoderNumChannelsGraph(Plot* plot) { |
1379 TimeSeries* time_series = | 1385 TimeSeries time_series = |
terelius
2017/04/18 16:17:54
Avoid extra copy.
philipel
2017/04/19 08:59:37
Done.
| |
1380 plot->AddTimeSeries("Audio encoder number of channels", LINE_DOT_GRAPH); | 1386 TimeSeries("Audio encoder number of channels", LINE_DOT_GRAPH); |
1381 ProcessPoints<AudioNetworkAdaptationEvent>( | 1387 ProcessPoints<AudioNetworkAdaptationEvent>( |
1382 [](const AudioNetworkAdaptationEvent& ana_event) { | 1388 [](const AudioNetworkAdaptationEvent& ana_event) { |
1383 if (ana_event.config.num_channels) | 1389 if (ana_event.config.num_channels) |
1384 return rtc::Optional<float>( | 1390 return rtc::Optional<float>( |
1385 static_cast<float>(*ana_event.config.num_channels)); | 1391 static_cast<float>(*ana_event.config.num_channels)); |
1386 return rtc::Optional<float>(); | 1392 return rtc::Optional<float>(); |
1387 }, | 1393 }, |
1388 audio_network_adaptation_events_, begin_time_, time_series); | 1394 audio_network_adaptation_events_, begin_time_, &time_series); |
1389 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 1395 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
1390 plot->SetSuggestedYAxis(0, 1, "Number of channels (1 (mono)/2 (stereo))", | 1396 plot->SetSuggestedYAxis(0, 1, "Number of channels (1 (mono)/2 (stereo))", |
1391 kBottomMargin, kTopMargin); | 1397 kBottomMargin, kTopMargin); |
1392 plot->SetTitle("Reported audio encoder number of channels"); | 1398 plot->SetTitle("Reported audio encoder number of channels"); |
1399 plot->AppendTimeSeries(std::move(time_series)); | |
1393 } | 1400 } |
1394 } // namespace plotting | 1401 } // namespace plotting |
1395 } // namespace webrtc | 1402 } // namespace webrtc |
OLD | NEW |