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

Side by Side Diff: webrtc/tools/event_log_visualizer/analyzer.cc

Issue 2824973003: Event log visualizer TimeSeries is now created on the stack and then moved into the vector of serie… (Closed)
Patch Set: Feedback Created 3 years, 8 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
« no previous file with comments | « no previous file | webrtc/tools/event_log_visualizer/plot_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
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
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("Fraction lost", LINE_DOT_GRAPH);
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
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("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("Loss-based estimate", LINE_STEP_GRAPH);
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("Delay-based estimate", LINE_STEP_GRAPH);
947 plot->AddTimeSeries("Delay-based estimate", LINE_STEP_GRAPH);
948 for (auto& delay_update : bwe_delay_updates_) { 947 for (auto& delay_update : bwe_delay_updates_) {
949 float x = 948 float x =
950 static_cast<float>(delay_update.timestamp - begin_time_) / 1000000; 949 static_cast<float>(delay_update.timestamp - begin_time_) / 1000000;
951 float y = static_cast<float>(delay_update.bitrate_bps) / 1000; 950 float y = static_cast<float>(delay_update.bitrate_bps) / 1000;
952 delay_series->points.emplace_back(x, y); 951 delay_series.points.emplace_back(x, y);
953 } 952 }
954 953
955 TimeSeries* created_series = 954 TimeSeries created_series("Probe cluster created.", DOT_GRAPH);
956 plot->AddTimeSeries("Probe cluster created.", DOT_GRAPH);
957 for (auto& cluster : bwe_probe_cluster_created_events_) { 955 for (auto& cluster : bwe_probe_cluster_created_events_) {
958 float x = static_cast<float>(cluster.timestamp - begin_time_) / 1000000; 956 float x = static_cast<float>(cluster.timestamp - begin_time_) / 1000000;
959 float y = static_cast<float>(cluster.bitrate_bps) / 1000; 957 float y = static_cast<float>(cluster.bitrate_bps) / 1000;
960 created_series->points.emplace_back(x, y); 958 created_series.points.emplace_back(x, y);
961 } 959 }
962 960
963 TimeSeries* result_series = 961 TimeSeries result_series("Probing results.", DOT_GRAPH);
964 plot->AddTimeSeries("Probing results.", DOT_GRAPH);
965 for (auto& result : bwe_probe_result_events_) { 962 for (auto& result : bwe_probe_result_events_) {
966 if (result.bitrate_bps) { 963 if (result.bitrate_bps) {
967 float x = static_cast<float>(result.timestamp - begin_time_) / 1000000; 964 float x = static_cast<float>(result.timestamp - begin_time_) / 1000000;
968 float y = static_cast<float>(*result.bitrate_bps) / 1000; 965 float y = static_cast<float>(*result.bitrate_bps) / 1000;
969 result_series->points.emplace_back(x, y); 966 result_series.points.emplace_back(x, y);
970 } 967 }
971 } 968 }
969
970 plot->AppendTimeSeries(std::move(loss_series));
971 plot->AppendTimeSeries(std::move(delay_series));
972 plot->AppendTimeSeries(std::move(created_series));
973 plot->AppendTimeSeries(std::move(result_series));
972 } 974 }
973 975
974 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 976 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
975 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin); 977 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin);
976 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { 978 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) {
977 plot->SetTitle("Incoming RTP bitrate"); 979 plot->SetTitle("Incoming RTP bitrate");
978 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { 980 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) {
979 plot->SetTitle("Outgoing RTP bitrate"); 981 plot->SetTitle("Outgoing RTP bitrate");
980 } 982 }
981 } 983 }
(...skipping 11 matching lines...) Expand all
993 continue; 995 continue;
994 } 996 }
995 997
996 TimeSeries time_series(GetStreamName(stream_id), LINE_GRAPH); 998 TimeSeries time_series(GetStreamName(stream_id), LINE_GRAPH);
997 MovingAverage<LoggedRtpPacket, double>( 999 MovingAverage<LoggedRtpPacket, double>(
998 [](const LoggedRtpPacket& packet) { 1000 [](const LoggedRtpPacket& packet) {
999 return rtc::Optional<double>(packet.total_length * 8.0 / 1000.0); 1001 return rtc::Optional<double>(packet.total_length * 8.0 / 1000.0);
1000 }, 1002 },
1001 packet_stream, begin_time_, end_time_, window_duration_, step_, 1003 packet_stream, begin_time_, end_time_, window_duration_, step_,
1002 &time_series); 1004 &time_series);
1003 plot->series_list_.push_back(std::move(time_series)); 1005 plot->AppendTimeSeries(std::move(time_series));
1004 } 1006 }
1005 1007
1006 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1008 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1007 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin); 1009 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin);
1008 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { 1010 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) {
1009 plot->SetTitle("Incoming bitrate per stream"); 1011 plot->SetTitle("Incoming bitrate per stream");
1010 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { 1012 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) {
1011 plot->SetTitle("Outgoing bitrate per stream"); 1013 plot->SetTitle("Outgoing bitrate per stream");
1012 } 1014 }
1013 } 1015 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 time_us - last_update_us >= 1e6) { 1121 time_us - last_update_us >= 1e6) {
1120 uint32_t y = observer.last_bitrate_bps() / 1000; 1122 uint32_t y = observer.last_bitrate_bps() / 1000;
1121 float x = static_cast<float>(clock.TimeInMicroseconds() - begin_time_) / 1123 float x = static_cast<float>(clock.TimeInMicroseconds() - begin_time_) /
1122 1000000; 1124 1000000;
1123 time_series.points.emplace_back(x, y); 1125 time_series.points.emplace_back(x, y);
1124 last_update_us = time_us; 1126 last_update_us = time_us;
1125 } 1127 }
1126 time_us = std::min({NextRtpTime(), NextRtcpTime(), NextProcessTime()}); 1128 time_us = std::min({NextRtpTime(), NextRtcpTime(), NextProcessTime()});
1127 } 1129 }
1128 // Add the data set to the plot. 1130 // Add the data set to the plot.
1129 plot->series_list_.push_back(std::move(time_series)); 1131 plot->AppendTimeSeries(std::move(time_series));
1130 plot->series_list_.push_back(std::move(acked_time_series)); 1132 plot->AppendTimeSeries(std::move(acked_time_series));
1131 1133
1132 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1134 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1133 plot->SetSuggestedYAxis(0, 10, "Bitrate (kbps)", kBottomMargin, kTopMargin); 1135 plot->SetSuggestedYAxis(0, 10, "Bitrate (kbps)", kBottomMargin, kTopMargin);
1134 plot->SetTitle("Simulated BWE behavior"); 1136 plot->SetTitle("Simulated BWE behavior");
1135 } 1137 }
1136 1138
1137 void EventLogAnalyzer::CreateNetworkDelayFeedbackGraph(Plot* plot) { 1139 void EventLogAnalyzer::CreateNetworkDelayFeedbackGraph(Plot* plot) {
1138 std::map<uint64_t, const LoggedRtpPacket*> outgoing_rtp; 1140 std::map<uint64_t, const LoggedRtpPacket*> outgoing_rtp;
1139 std::map<uint64_t, const LoggedRtcpPacket*> incoming_rtcp; 1141 std::map<uint64_t, const LoggedRtcpPacket*> incoming_rtcp;
1140 1142
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 } 1212 }
1211 ++rtp_iterator; 1213 ++rtp_iterator;
1212 } 1214 }
1213 time_us = std::min(NextRtpTime(), NextRtcpTime()); 1215 time_us = std::min(NextRtpTime(), NextRtcpTime());
1214 } 1216 }
1215 // We assume that the base network delay (w/o queues) is the min delay 1217 // We assume that the base network delay (w/o queues) is the min delay
1216 // observed during the call. 1218 // observed during the call.
1217 for (TimeSeriesPoint& point : time_series.points) 1219 for (TimeSeriesPoint& point : time_series.points)
1218 point.y -= estimated_base_delay_ms; 1220 point.y -= estimated_base_delay_ms;
1219 // Add the data set to the plot. 1221 // Add the data set to the plot.
1220 plot->series_list_.push_back(std::move(time_series)); 1222 plot->AppendTimeSeries(std::move(time_series));
1221 1223
1222 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1224 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1223 plot->SetSuggestedYAxis(0, 10, "Delay (ms)", kBottomMargin, kTopMargin); 1225 plot->SetSuggestedYAxis(0, 10, "Delay (ms)", kBottomMargin, kTopMargin);
1224 plot->SetTitle("Network Delay Change."); 1226 plot->SetTitle("Network Delay Change.");
1225 } 1227 }
1226 1228
1227 std::vector<std::pair<int64_t, int64_t>> EventLogAnalyzer::GetFrameTimestamps() 1229 std::vector<std::pair<int64_t, int64_t>> EventLogAnalyzer::GetFrameTimestamps()
1228 const { 1230 const {
1229 std::vector<std::pair<int64_t, int64_t>> timestamps; 1231 std::vector<std::pair<int64_t, int64_t>> timestamps;
1230 size_t largest_stream_size = 0; 1232 size_t largest_stream_size = 0;
(...skipping 27 matching lines...) Expand all
1258 StreamId stream_id = kv.first; 1260 StreamId stream_id = kv.first;
1259 1261
1260 { 1262 {
1261 TimeSeries timestamp_data(GetStreamName(stream_id) + " capture-time", 1263 TimeSeries timestamp_data(GetStreamName(stream_id) + " capture-time",
1262 LINE_DOT_GRAPH); 1264 LINE_DOT_GRAPH);
1263 for (LoggedRtpPacket packet : rtp_packets) { 1265 for (LoggedRtpPacket packet : rtp_packets) {
1264 float x = static_cast<float>(packet.timestamp - begin_time_) / 1000000; 1266 float x = static_cast<float>(packet.timestamp - begin_time_) / 1000000;
1265 float y = packet.header.timestamp; 1267 float y = packet.header.timestamp;
1266 timestamp_data.points.emplace_back(x, y); 1268 timestamp_data.points.emplace_back(x, y);
1267 } 1269 }
1268 plot->series_list_.push_back(std::move(timestamp_data)); 1270 plot->AppendTimeSeries(std::move(timestamp_data));
1269 } 1271 }
1270 1272
1271 { 1273 {
1272 auto kv = rtcp_packets_.find(stream_id); 1274 auto kv = rtcp_packets_.find(stream_id);
1273 if (kv != rtcp_packets_.end()) { 1275 if (kv != rtcp_packets_.end()) {
1274 const auto& packets = kv->second; 1276 const auto& packets = kv->second;
1275 TimeSeries timestamp_data( 1277 TimeSeries timestamp_data(
1276 GetStreamName(stream_id) + " rtcp capture-time", LINE_DOT_GRAPH); 1278 GetStreamName(stream_id) + " rtcp capture-time", LINE_DOT_GRAPH);
1277 for (const LoggedRtcpPacket& rtcp : packets) { 1279 for (const LoggedRtcpPacket& rtcp : packets) {
1278 if (rtcp.type != kRtcpSr) 1280 if (rtcp.type != kRtcpSr)
1279 continue; 1281 continue;
1280 rtcp::SenderReport* sr; 1282 rtcp::SenderReport* sr;
1281 sr = static_cast<rtcp::SenderReport*>(rtcp.packet.get()); 1283 sr = static_cast<rtcp::SenderReport*>(rtcp.packet.get());
1282 float x = static_cast<float>(rtcp.timestamp - begin_time_) / 1000000; 1284 float x = static_cast<float>(rtcp.timestamp - begin_time_) / 1000000;
1283 float y = sr->rtp_timestamp(); 1285 float y = sr->rtp_timestamp();
1284 timestamp_data.points.emplace_back(x, y); 1286 timestamp_data.points.emplace_back(x, y);
1285 } 1287 }
1286 plot->series_list_.push_back(std::move(timestamp_data)); 1288 plot->AppendTimeSeries(std::move(timestamp_data));
1287 } 1289 }
1288 } 1290 }
1289 } 1291 }
1290 1292
1291 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1293 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1292 plot->SetSuggestedYAxis(0, 1, "Timestamp (90khz)", kBottomMargin, kTopMargin); 1294 plot->SetSuggestedYAxis(0, 1, "Timestamp (90khz)", kBottomMargin, kTopMargin);
1293 plot->SetTitle("Timestamps"); 1295 plot->SetTitle("Timestamps");
1294 } 1296 }
1295 1297
1296 void EventLogAnalyzer::CreateAudioEncoderTargetBitrateGraph(Plot* plot) { 1298 void EventLogAnalyzer::CreateAudioEncoderTargetBitrateGraph(Plot* plot) {
1297 TimeSeries* time_series = 1299 TimeSeries time_series("Audio encoder target bitrate", LINE_DOT_GRAPH);
1298 plot->AddTimeSeries("Audio encoder target bitrate", LINE_DOT_GRAPH);
1299 ProcessPoints<AudioNetworkAdaptationEvent>( 1300 ProcessPoints<AudioNetworkAdaptationEvent>(
1300 [](const AudioNetworkAdaptationEvent& ana_event) -> rtc::Optional<float> { 1301 [](const AudioNetworkAdaptationEvent& ana_event) -> rtc::Optional<float> {
1301 if (ana_event.config.bitrate_bps) 1302 if (ana_event.config.bitrate_bps)
1302 return rtc::Optional<float>( 1303 return rtc::Optional<float>(
1303 static_cast<float>(*ana_event.config.bitrate_bps)); 1304 static_cast<float>(*ana_event.config.bitrate_bps));
1304 return rtc::Optional<float>(); 1305 return rtc::Optional<float>();
1305 }, 1306 },
1306 audio_network_adaptation_events_, begin_time_, time_series); 1307 audio_network_adaptation_events_, begin_time_, &time_series);
1307 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1308 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1308 plot->SetSuggestedYAxis(0, 1, "Bitrate (bps)", kBottomMargin, kTopMargin); 1309 plot->SetSuggestedYAxis(0, 1, "Bitrate (bps)", kBottomMargin, kTopMargin);
1309 plot->SetTitle("Reported audio encoder target bitrate"); 1310 plot->SetTitle("Reported audio encoder target bitrate");
1311 plot->AppendTimeSeries(std::move(time_series));
terelius 2017/04/19 09:20:18 nit: I'd like to finish the timeseries specific th
philipel 2017/04/19 12:32:11 Done.
1310 } 1312 }
1311 1313
1312 void EventLogAnalyzer::CreateAudioEncoderFrameLengthGraph(Plot* plot) { 1314 void EventLogAnalyzer::CreateAudioEncoderFrameLengthGraph(Plot* plot) {
1313 TimeSeries* time_series = 1315 TimeSeries time_series("Audio encoder frame length", LINE_DOT_GRAPH);
1314 plot->AddTimeSeries("Audio encoder frame length", LINE_DOT_GRAPH);
1315 ProcessPoints<AudioNetworkAdaptationEvent>( 1316 ProcessPoints<AudioNetworkAdaptationEvent>(
1316 [](const AudioNetworkAdaptationEvent& ana_event) { 1317 [](const AudioNetworkAdaptationEvent& ana_event) {
1317 if (ana_event.config.frame_length_ms) 1318 if (ana_event.config.frame_length_ms)
1318 return rtc::Optional<float>( 1319 return rtc::Optional<float>(
1319 static_cast<float>(*ana_event.config.frame_length_ms)); 1320 static_cast<float>(*ana_event.config.frame_length_ms));
1320 return rtc::Optional<float>(); 1321 return rtc::Optional<float>();
1321 }, 1322 },
1322 audio_network_adaptation_events_, begin_time_, time_series); 1323 audio_network_adaptation_events_, begin_time_, &time_series);
1323 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1324 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1324 plot->SetSuggestedYAxis(0, 1, "Frame length (ms)", kBottomMargin, kTopMargin); 1325 plot->SetSuggestedYAxis(0, 1, "Frame length (ms)", kBottomMargin, kTopMargin);
1325 plot->SetTitle("Reported audio encoder frame length"); 1326 plot->SetTitle("Reported audio encoder frame length");
1327 plot->AppendTimeSeries(std::move(time_series));
1326 } 1328 }
1327 1329
1328 void EventLogAnalyzer::CreateAudioEncoderUplinkPacketLossFractionGraph( 1330 void EventLogAnalyzer::CreateAudioEncoderUplinkPacketLossFractionGraph(
1329 Plot* plot) { 1331 Plot* plot) {
1330 TimeSeries* time_series = plot->AddTimeSeries( 1332 TimeSeries time_series("Audio encoder uplink packet loss fraction",
1331 "Audio encoder uplink packet loss fraction", LINE_DOT_GRAPH); 1333 LINE_DOT_GRAPH);
1332 ProcessPoints<AudioNetworkAdaptationEvent>( 1334 ProcessPoints<AudioNetworkAdaptationEvent>(
1333 [](const AudioNetworkAdaptationEvent& ana_event) { 1335 [](const AudioNetworkAdaptationEvent& ana_event) {
1334 if (ana_event.config.uplink_packet_loss_fraction) 1336 if (ana_event.config.uplink_packet_loss_fraction)
1335 return rtc::Optional<float>(static_cast<float>( 1337 return rtc::Optional<float>(static_cast<float>(
1336 *ana_event.config.uplink_packet_loss_fraction)); 1338 *ana_event.config.uplink_packet_loss_fraction));
1337 return rtc::Optional<float>(); 1339 return rtc::Optional<float>();
1338 }, 1340 },
1339 audio_network_adaptation_events_, begin_time_, time_series); 1341 audio_network_adaptation_events_, begin_time_, &time_series);
1340 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1342 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1341 plot->SetSuggestedYAxis(0, 10, "Percent lost packets", kBottomMargin, 1343 plot->SetSuggestedYAxis(0, 10, "Percent lost packets", kBottomMargin,
1342 kTopMargin); 1344 kTopMargin);
1343 plot->SetTitle("Reported audio encoder lost packets"); 1345 plot->SetTitle("Reported audio encoder lost packets");
1346 plot->AppendTimeSeries(std::move(time_series));
1344 } 1347 }
1345 1348
1346 void EventLogAnalyzer::CreateAudioEncoderEnableFecGraph(Plot* plot) { 1349 void EventLogAnalyzer::CreateAudioEncoderEnableFecGraph(Plot* plot) {
1347 TimeSeries* time_series = 1350 TimeSeries time_series("Audio encoder FEC", LINE_DOT_GRAPH);
1348 plot->AddTimeSeries("Audio encoder FEC", LINE_DOT_GRAPH);
1349 ProcessPoints<AudioNetworkAdaptationEvent>( 1351 ProcessPoints<AudioNetworkAdaptationEvent>(
1350 [](const AudioNetworkAdaptationEvent& ana_event) { 1352 [](const AudioNetworkAdaptationEvent& ana_event) {
1351 if (ana_event.config.enable_fec) 1353 if (ana_event.config.enable_fec)
1352 return rtc::Optional<float>( 1354 return rtc::Optional<float>(
1353 static_cast<float>(*ana_event.config.enable_fec)); 1355 static_cast<float>(*ana_event.config.enable_fec));
1354 return rtc::Optional<float>(); 1356 return rtc::Optional<float>();
1355 }, 1357 },
1356 audio_network_adaptation_events_, begin_time_, time_series); 1358 audio_network_adaptation_events_, begin_time_, &time_series);
1357 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1359 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1358 plot->SetSuggestedYAxis(0, 1, "FEC (false/true)", kBottomMargin, kTopMargin); 1360 plot->SetSuggestedYAxis(0, 1, "FEC (false/true)", kBottomMargin, kTopMargin);
1359 plot->SetTitle("Reported audio encoder FEC"); 1361 plot->SetTitle("Reported audio encoder FEC");
1362 plot->AppendTimeSeries(std::move(time_series));
1360 } 1363 }
1361 1364
1362 void EventLogAnalyzer::CreateAudioEncoderEnableDtxGraph(Plot* plot) { 1365 void EventLogAnalyzer::CreateAudioEncoderEnableDtxGraph(Plot* plot) {
1363 TimeSeries* time_series = 1366 TimeSeries time_series("Audio encoder DTX", LINE_DOT_GRAPH);
1364 plot->AddTimeSeries("Audio encoder DTX", LINE_DOT_GRAPH);
1365 ProcessPoints<AudioNetworkAdaptationEvent>( 1367 ProcessPoints<AudioNetworkAdaptationEvent>(
1366 [](const AudioNetworkAdaptationEvent& ana_event) { 1368 [](const AudioNetworkAdaptationEvent& ana_event) {
1367 if (ana_event.config.enable_dtx) 1369 if (ana_event.config.enable_dtx)
1368 return rtc::Optional<float>( 1370 return rtc::Optional<float>(
1369 static_cast<float>(*ana_event.config.enable_dtx)); 1371 static_cast<float>(*ana_event.config.enable_dtx));
1370 return rtc::Optional<float>(); 1372 return rtc::Optional<float>();
1371 }, 1373 },
1372 audio_network_adaptation_events_, begin_time_, time_series); 1374 audio_network_adaptation_events_, begin_time_, &time_series);
1373 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1375 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1374 plot->SetSuggestedYAxis(0, 1, "DTX (false/true)", kBottomMargin, kTopMargin); 1376 plot->SetSuggestedYAxis(0, 1, "DTX (false/true)", kBottomMargin, kTopMargin);
1375 plot->SetTitle("Reported audio encoder DTX"); 1377 plot->SetTitle("Reported audio encoder DTX");
1378 plot->AppendTimeSeries(std::move(time_series));
1376 } 1379 }
1377 1380
1378 void EventLogAnalyzer::CreateAudioEncoderNumChannelsGraph(Plot* plot) { 1381 void EventLogAnalyzer::CreateAudioEncoderNumChannelsGraph(Plot* plot) {
1379 TimeSeries* time_series = 1382 TimeSeries time_series("Audio encoder number of channels", LINE_DOT_GRAPH);
1380 plot->AddTimeSeries("Audio encoder number of channels", LINE_DOT_GRAPH);
1381 ProcessPoints<AudioNetworkAdaptationEvent>( 1383 ProcessPoints<AudioNetworkAdaptationEvent>(
1382 [](const AudioNetworkAdaptationEvent& ana_event) { 1384 [](const AudioNetworkAdaptationEvent& ana_event) {
1383 if (ana_event.config.num_channels) 1385 if (ana_event.config.num_channels)
1384 return rtc::Optional<float>( 1386 return rtc::Optional<float>(
1385 static_cast<float>(*ana_event.config.num_channels)); 1387 static_cast<float>(*ana_event.config.num_channels));
1386 return rtc::Optional<float>(); 1388 return rtc::Optional<float>();
1387 }, 1389 },
1388 audio_network_adaptation_events_, begin_time_, time_series); 1390 audio_network_adaptation_events_, begin_time_, &time_series);
1389 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1391 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1390 plot->SetSuggestedYAxis(0, 1, "Number of channels (1 (mono)/2 (stereo))", 1392 plot->SetSuggestedYAxis(0, 1, "Number of channels (1 (mono)/2 (stereo))",
1391 kBottomMargin, kTopMargin); 1393 kBottomMargin, kTopMargin);
1392 plot->SetTitle("Reported audio encoder number of channels"); 1394 plot->SetTitle("Reported audio encoder number of channels");
1395 plot->AppendTimeSeries(std::move(time_series));
1393 } 1396 }
1394 } // namespace plotting 1397 } // namespace plotting
1395 } // namespace webrtc 1398 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/tools/event_log_visualizer/plot_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698