From a0a8ed78c3f89751d1589c1d66ad61d2b9f7e562 Mon Sep 17 00:00:00 2001 From: stefan Date: Wed, 6 Sep 2017 02:06:32 -0700 Subject: [PATCH] Add visualization of late feedback packets, and avoid plotting incorrect delays computed based on those. BUG=None Review-Url: https://codereview.webrtc.org/3009823002 Cr-Commit-Position: refs/heads/master@{#19705} --- webrtc/rtc_tools/event_log_visualizer/analyzer.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/webrtc/rtc_tools/event_log_visualizer/analyzer.cc b/webrtc/rtc_tools/event_log_visualizer/analyzer.cc index 4d485c72d1..8358d3b24b 100644 --- a/webrtc/rtc_tools/event_log_visualizer/analyzer.cc +++ b/webrtc/rtc_tools/event_log_visualizer/analyzer.cc @@ -1247,6 +1247,7 @@ void EventLogAnalyzer::CreateNetworkDelayFeedbackGraph(Plot* plot) { SimulatedClock clock(0); TransportFeedbackAdapter feedback_adapter(&clock); + TimeSeries late_feedback_series("Late feedback results.", DOT_GRAPH); TimeSeries time_series("Network Delay Change", LINE_DOT_GRAPH); int64_t estimated_base_delay_ms = std::numeric_limits::max(); @@ -1266,6 +1267,7 @@ void EventLogAnalyzer::CreateNetworkDelayFeedbackGraph(Plot* plot) { }; int64_t time_us = std::min(NextRtpTime(), NextRtcpTime()); + int64_t prev_y = 0; while (time_us != std::numeric_limits::max()) { clock.AdvanceTimeMicroseconds(time_us - clock.TimeInMicroseconds()); if (clock.TimeInMicroseconds() >= NextRtcpTime()) { @@ -1278,10 +1280,15 @@ void EventLogAnalyzer::CreateNetworkDelayFeedbackGraph(Plot* plot) { feedback_adapter.GetTransportFeedbackVector(); SortPacketFeedbackVector(&feedback); for (const PacketFeedback& packet : feedback) { - int64_t y = packet.arrival_time_ms - packet.send_time_ms; float x = static_cast(clock.TimeInMicroseconds() - begin_time_) / 1000000; + if (packet.send_time_ms == -1) { + late_feedback_series.points.emplace_back(x, prev_y); + continue; + } + int64_t y = packet.arrival_time_ms - packet.send_time_ms; + prev_y = y; estimated_base_delay_ms = std::min(y, estimated_base_delay_ms); time_series.points.emplace_back(x, y); } @@ -1307,8 +1314,11 @@ void EventLogAnalyzer::CreateNetworkDelayFeedbackGraph(Plot* plot) { // observed during the call. for (TimeSeriesPoint& point : time_series.points) point.y -= estimated_base_delay_ms; + for (TimeSeriesPoint& point : late_feedback_series.points) + point.y -= estimated_base_delay_ms; // Add the data set to the plot. - plot->AppendTimeSeries(std::move(time_series)); + plot->AppendTimeSeriesIfNotEmpty(std::move(time_series)); + plot->AppendTimeSeriesIfNotEmpty(std::move(late_feedback_series)); plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); plot->SetSuggestedYAxis(0, 10, "Delay (ms)", kBottomMargin, kTopMargin);