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..04e5fd94151878ae6efa89db45b57b1c61557981 100644 |
--- a/webrtc/tools/event_log_visualizer/analyzer.cc |
+++ b/webrtc/tools/event_log_visualizer/analyzer.cc |
@@ -204,6 +204,14 @@ EventLogAnalyzer::EventLogAnalyzer(const ParsedRtcEventLog& log) |
break; |
} |
case ParsedRtcEventLog::BWE_PACKET_LOSS_EVENT: { |
+ uint64_t timestamp = parsed_log_.GetTimestamp(i); |
+ int32_t bitrate; |
+ uint8_t fraction_loss; |
+ int32_t expected_packets; |
+ parsed_log_.GetBwePacketLossEvent(i, &bitrate, &fraction_loss, |
+ &expected_packets); |
+ bwe_loss_updates_.push_back(BwePacketLossEvent( |
ivoc
2016/07/19 09:42:48
You could use emplace_back here to construct the o
terelius
2016/07/19 13:06:18
Changed the GetBwePacketLossEvent to write the dir
|
+ timestamp, bitrate, fraction_loss, expected_packets)); |
break; |
} |
case ParsedRtcEventLog::BWE_PACKET_DELAY_EVENT: { |
@@ -557,6 +565,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.push_back(TimeSeriesPoint(x, y)); |
ivoc
2016/07/19 09:42:48
Another opportunity for emplace_back.
terelius
2016/07/19 13:06:18
Done.
|
+ } |
+ 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)"; |