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

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

Issue 2983983002: Improved UI for event_log_analyzer tool (Closed)
Patch Set: Rebase Created 3 years, 4 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
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 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 } 806 }
807 plot->AppendTimeSeries(std::move(time_series)); 807 plot->AppendTimeSeries(std::move(time_series));
808 } 808 }
809 809
810 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 810 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
811 plot->SetSuggestedYAxis(0, 1, "Estimated loss rate (%)", kBottomMargin, 811 plot->SetSuggestedYAxis(0, 1, "Estimated loss rate (%)", kBottomMargin,
812 kTopMargin); 812 kTopMargin);
813 plot->SetTitle("Estimated incoming loss rate"); 813 plot->SetTitle("Estimated incoming loss rate");
814 } 814 }
815 815
816 void EventLogAnalyzer::CreateDelayChangeGraph(Plot* plot) { 816 void EventLogAnalyzer::CreateIncomingDelayDeltaGraph(Plot* plot) {
817 for (auto& kv : rtp_packets_) { 817 for (auto& kv : rtp_packets_) {
818 StreamId stream_id = kv.first; 818 StreamId stream_id = kv.first;
819 const std::vector<LoggedRtpPacket>& packet_stream = kv.second; 819 const std::vector<LoggedRtpPacket>& packet_stream = kv.second;
820 // Filter on direction and SSRC. 820 // Filter on direction and SSRC.
821 if (stream_id.GetDirection() != kIncomingPacket || 821 if (stream_id.GetDirection() != kIncomingPacket ||
822 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_) || 822 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_) ||
823 IsAudioSsrc(stream_id) || !IsVideoSsrc(stream_id) || 823 IsAudioSsrc(stream_id) || !IsVideoSsrc(stream_id) ||
824 IsRtxSsrc(stream_id)) { 824 IsRtxSsrc(stream_id)) {
825 continue; 825 continue;
826 } 826 }
827 827
828 TimeSeries capture_time_data(GetStreamName(stream_id) + " capture-time", 828 TimeSeries capture_time_data(GetStreamName(stream_id) + " capture-time",
829 BAR_GRAPH); 829 BAR_GRAPH);
830 ProcessPairs<LoggedRtpPacket, double>(NetworkDelayDiff_CaptureTime, 830 ProcessPairs<LoggedRtpPacket, double>(NetworkDelayDiff_CaptureTime,
831 packet_stream, begin_time_, 831 packet_stream, begin_time_,
832 &capture_time_data); 832 &capture_time_data);
833 plot->AppendTimeSeries(std::move(capture_time_data)); 833 plot->AppendTimeSeries(std::move(capture_time_data));
834 834
835 TimeSeries send_time_data(GetStreamName(stream_id) + " abs-send-time", 835 TimeSeries send_time_data(GetStreamName(stream_id) + " abs-send-time",
836 BAR_GRAPH); 836 BAR_GRAPH);
837 ProcessPairs<LoggedRtpPacket, double>(NetworkDelayDiff_AbsSendTime, 837 ProcessPairs<LoggedRtpPacket, double>(NetworkDelayDiff_AbsSendTime,
838 packet_stream, begin_time_, 838 packet_stream, begin_time_,
839 &send_time_data); 839 &send_time_data);
840 plot->AppendTimeSeries(std::move(send_time_data)); 840 plot->AppendTimeSeries(std::move(send_time_data));
841 } 841 }
842 842
843 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 843 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
844 plot->SetSuggestedYAxis(0, 1, "Latency change (ms)", kBottomMargin, 844 plot->SetSuggestedYAxis(0, 1, "Latency change (ms)", kBottomMargin,
845 kTopMargin); 845 kTopMargin);
846 plot->SetTitle("Network latency change between consecutive packets"); 846 plot->SetTitle("Network latency difference between consecutive packets");
847 } 847 }
848 848
849 void EventLogAnalyzer::CreateAccumulatedDelayChangeGraph(Plot* plot) { 849 void EventLogAnalyzer::CreateIncomingDelayGraph(Plot* plot) {
850 for (auto& kv : rtp_packets_) { 850 for (auto& kv : rtp_packets_) {
851 StreamId stream_id = kv.first; 851 StreamId stream_id = kv.first;
852 const std::vector<LoggedRtpPacket>& packet_stream = kv.second; 852 const std::vector<LoggedRtpPacket>& packet_stream = kv.second;
853 // Filter on direction and SSRC. 853 // Filter on direction and SSRC.
854 if (stream_id.GetDirection() != kIncomingPacket || 854 if (stream_id.GetDirection() != kIncomingPacket ||
855 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_) || 855 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_) ||
856 IsAudioSsrc(stream_id) || !IsVideoSsrc(stream_id) || 856 IsAudioSsrc(stream_id) || !IsVideoSsrc(stream_id) ||
857 IsRtxSsrc(stream_id)) { 857 IsRtxSsrc(stream_id)) {
858 continue; 858 continue;
859 } 859 }
860 860
861 TimeSeries capture_time_data(GetStreamName(stream_id) + " capture-time", 861 TimeSeries capture_time_data(GetStreamName(stream_id) + " capture-time",
862 LINE_GRAPH); 862 LINE_GRAPH);
863 AccumulatePairs<LoggedRtpPacket, double>(NetworkDelayDiff_CaptureTime, 863 AccumulatePairs<LoggedRtpPacket, double>(NetworkDelayDiff_CaptureTime,
864 packet_stream, begin_time_, 864 packet_stream, begin_time_,
865 &capture_time_data); 865 &capture_time_data);
866 plot->AppendTimeSeries(std::move(capture_time_data)); 866 plot->AppendTimeSeries(std::move(capture_time_data));
867 867
868 TimeSeries send_time_data(GetStreamName(stream_id) + " abs-send-time", 868 TimeSeries send_time_data(GetStreamName(stream_id) + " abs-send-time",
869 LINE_GRAPH); 869 LINE_GRAPH);
870 AccumulatePairs<LoggedRtpPacket, double>(NetworkDelayDiff_AbsSendTime, 870 AccumulatePairs<LoggedRtpPacket, double>(NetworkDelayDiff_AbsSendTime,
871 packet_stream, begin_time_, 871 packet_stream, begin_time_,
872 &send_time_data); 872 &send_time_data);
873 plot->AppendTimeSeries(std::move(send_time_data)); 873 plot->AppendTimeSeries(std::move(send_time_data));
874 } 874 }
875 875
876 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 876 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
877 plot->SetSuggestedYAxis(0, 1, "Latency change (ms)", kBottomMargin, 877 plot->SetSuggestedYAxis(0, 1, "Latency change (ms)", kBottomMargin,
878 kTopMargin); 878 kTopMargin);
879 plot->SetTitle("Accumulated network latency change"); 879 plot->SetTitle("Network latency (relative to first packet)");
880 } 880 }
881 881
882 // Plot the fraction of packets lost (as perceived by the loss-based BWE). 882 // Plot the fraction of packets lost (as perceived by the loss-based BWE).
883 void EventLogAnalyzer::CreateFractionLossGraph(Plot* plot) { 883 void EventLogAnalyzer::CreateFractionLossGraph(Plot* plot) {
884 TimeSeries time_series("Fraction lost", LINE_DOT_GRAPH); 884 TimeSeries time_series("Fraction lost", LINE_DOT_GRAPH);
885 for (auto& bwe_update : bwe_loss_updates_) { 885 for (auto& bwe_update : bwe_loss_updates_) {
886 float x = static_cast<float>(bwe_update.timestamp - begin_time_) / 1000000; 886 float x = static_cast<float>(bwe_update.timestamp - begin_time_) / 1000000;
887 float y = static_cast<float>(bwe_update.fraction_loss) / 255 * 100; 887 float y = static_cast<float>(bwe_update.fraction_loss) / 255 * 100;
888 time_series.points.emplace_back(x, y); 888 time_series.points.emplace_back(x, y);
889 } 889 }
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 static_cast<float>(*ana_event.config.frame_length_ms)); 1401 static_cast<float>(*ana_event.config.frame_length_ms));
1402 return rtc::Optional<float>(); 1402 return rtc::Optional<float>();
1403 }, 1403 },
1404 audio_network_adaptation_events_, begin_time_, &time_series); 1404 audio_network_adaptation_events_, begin_time_, &time_series);
1405 plot->AppendTimeSeries(std::move(time_series)); 1405 plot->AppendTimeSeries(std::move(time_series));
1406 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1406 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1407 plot->SetSuggestedYAxis(0, 1, "Frame length (ms)", kBottomMargin, kTopMargin); 1407 plot->SetSuggestedYAxis(0, 1, "Frame length (ms)", kBottomMargin, kTopMargin);
1408 plot->SetTitle("Reported audio encoder frame length"); 1408 plot->SetTitle("Reported audio encoder frame length");
1409 } 1409 }
1410 1410
1411 void EventLogAnalyzer::CreateAudioEncoderUplinkPacketLossFractionGraph( 1411 void EventLogAnalyzer::CreateAudioEncoderPacketLossGraph(Plot* plot) {
1412 Plot* plot) {
1413 TimeSeries time_series("Audio encoder uplink packet loss fraction", 1412 TimeSeries time_series("Audio encoder uplink packet loss fraction",
1414 LINE_DOT_GRAPH); 1413 LINE_DOT_GRAPH);
1415 ProcessPoints<AudioNetworkAdaptationEvent>( 1414 ProcessPoints<AudioNetworkAdaptationEvent>(
1416 [](const AudioNetworkAdaptationEvent& ana_event) { 1415 [](const AudioNetworkAdaptationEvent& ana_event) {
1417 if (ana_event.config.uplink_packet_loss_fraction) 1416 if (ana_event.config.uplink_packet_loss_fraction)
1418 return rtc::Optional<float>(static_cast<float>( 1417 return rtc::Optional<float>(static_cast<float>(
1419 *ana_event.config.uplink_packet_loss_fraction)); 1418 *ana_event.config.uplink_packet_loss_fraction));
1420 return rtc::Optional<float>(); 1419 return rtc::Optional<float>();
1421 }, 1420 },
1422 audio_network_adaptation_events_, begin_time_, &time_series); 1421 audio_network_adaptation_events_, begin_time_, &time_series);
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 plot->AppendTimeSeries(std::move(series.second)); 1710 plot->AppendTimeSeries(std::move(series.second));
1712 } 1711 }
1713 1712
1714 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1713 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1715 plot->SetYAxis(min_y_axis, max_y_axis, "Relative delay (ms)", kBottomMargin, 1714 plot->SetYAxis(min_y_axis, max_y_axis, "Relative delay (ms)", kBottomMargin,
1716 kTopMargin); 1715 kTopMargin);
1717 plot->SetTitle("NetEq timing"); 1716 plot->SetTitle("NetEq timing");
1718 } 1717 }
1719 } // namespace plotting 1718 } // namespace plotting
1720 } // namespace webrtc 1719 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/rtc_tools/event_log_visualizer/analyzer.h ('k') | webrtc/rtc_tools/event_log_visualizer/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698