Index: webrtc/tools/event_log_visualizer/analyzer.cc |
diff --git a/webrtc/tools/event_log_visualizer/analyzer.cc b/webrtc/tools/event_log_visualizer/analyzer.cc |
index ec569990224d2a9d7e951e3e06d24793e98c06e3..e6dd35b6c6fa10e1d62f23cda08b2b36bf9ea792 100644 |
--- a/webrtc/tools/event_log_visualizer/analyzer.cc |
+++ b/webrtc/tools/event_log_visualizer/analyzer.cc |
@@ -204,6 +204,12 @@ EventLogAnalyzer::EventLogAnalyzer(const ParsedRtcEventLog& log) |
break; |
} |
case ParsedRtcEventLog::BWE_PACKET_LOSS_EVENT: { |
+ BwePacketLossEvent bwe_update; |
+ bwe_update.timestamp = parsed_log_.GetTimestamp(i); |
+ parsed_log_.GetBwePacketLossEvent(i, &bwe_update.new_bitrate, |
+ &bwe_update.fraction_loss, |
+ &bwe_update.expected_packets); |
+ bwe_loss_updates_.push_back(bwe_update); |
break; |
} |
case ParsedRtcEventLog::BWE_PACKET_DELAY_EVENT: { |
@@ -557,6 +563,20 @@ void EventLogAnalyzer::CreateTotalBitrateGraph( |
} |
plot->series.back().style = LINE_GRAPH; |
+ // Overlay the send-side bandwidth estimate over the outgoing bitrate. |
+ if (desired_direction == kOutgoingPacket) { |
+ plot->series.push_back(TimeSeries()); |
+ for (auto& bwe_update : bwe_loss_updates_) { |
+ float x = |
+ static_cast<float>(bwe_update.timestamp - begin_time_) / 1000000; |
+ float y = static_cast<float>(bwe_update.new_bitrate) / 1000; |
+ max_y = std::max(max_y, y); |
+ plot->series.back().points.emplace_back(x, y); |
+ } |
+ plot->series.back().label = "Loss-based estimate"; |
+ plot->series.back().style = LINE_GRAPH; |
+ } |
+ |
plot->xaxis_min = kDefaultXMin; |
plot->xaxis_max = (end_time_ - begin_time_) / 1000000 * kXMargin; |
plot->xaxis_label = "Time (s)"; |