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

Unified Diff: webrtc/tools/event_log_visualizer/analyzer.cc

Issue 2295063006: Plot accumelated packets over time. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
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 2a23c94a7dbe325e5d66d96bc334e756db804a83..4f609922530320b20200d4301913ea648e581390 100644
--- a/webrtc/tools/event_log_visualizer/analyzer.cc
+++ b/webrtc/tools/event_log_visualizer/analyzer.cc
@@ -498,6 +498,66 @@ void EventLogAnalyzer::CreatePacketGraph(PacketDirection desired_direction,
}
}
+void EventLogAnalyzer::CreateAccumelatedPacketsGraph(
+ PacketDirection desired_direction,
+ Plot* plot) {
+ // RTP packet
stefan-webrtc 2016/09/02 12:12:17 RTP packets.
philipel 2016/09/02 13:15:25 Done.
+ for (auto& kv : rtp_packets_) {
+ StreamId stream_id = kv.first;
+ const std::vector<LoggedRtpPacket>& packet_stream = kv.second;
+ // Filter on direction and SSRC.
+ if (stream_id.GetDirection() != desired_direction ||
+ !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_)) {
+ continue;
+ }
+
+ TimeSeries time_series;
+ time_series.label = "RTP: " + SsrcToString(stream_id.GetSsrc());
+ time_series.style = LINE_GRAPH;
+
+ for (size_t i = 0; i < packet_stream.size(); i++) {
+ float x = static_cast<float>(packet_stream[i].timestamp - begin_time_) /
+ 1000000;
+ time_series.points.emplace_back(x, i);
+ time_series.points.emplace_back(x, i + 1);
+ }
+
+ plot->series_list_.push_back(std::move(time_series));
+ }
stefan-webrtc 2016/09/02 12:12:17 Can you break this out into a separate function an
philipel 2016/09/02 13:15:25 Done.
+
+ // RTCP packet
stefan-webrtc 2016/09/02 12:12:16 RTCP packets.
philipel 2016/09/02 13:15:25 Done.
+ for (auto& kv : rtcp_packets_) {
+ StreamId stream_id = kv.first;
+ const std::vector<LoggedRtcpPacket>& packet_stream = kv.second;
+ // Filter on direction and SSRC.
+ if (stream_id.GetDirection() != desired_direction ||
+ !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_)) {
+ continue;
+ }
+
+ TimeSeries time_series;
+ time_series.label = "RTCP: " + SsrcToString(stream_id.GetSsrc());
+ time_series.style = LINE_GRAPH;
+
+ for (size_t i = 0; i < packet_stream.size(); i++) {
+ float x = static_cast<float>(packet_stream[i].timestamp - begin_time_) /
+ 1000000;
+ time_series.points.emplace_back(x, i);
+ time_series.points.emplace_back(x, i + 1);
+ }
+
+ plot->series_list_.push_back(std::move(time_series));
+ }
+
+ plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
+ plot->SetSuggestedYAxis(0, 1, "Received Packets", kBottomMargin, kTopMargin);
+ if (desired_direction == webrtc::PacketDirection::kIncomingPacket) {
+ plot->SetTitle("Accumelated Incoming RTP/RTCP packets");
stefan-webrtc 2016/09/02 12:12:16 "Accumulated" here and below.
philipel 2016/09/02 13:15:25 Done.
+ } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) {
+ plot->SetTitle("Accumelated Outgoing RTP/RTCP packets");
+ }
+}
+
// For each SSRC, plot the time between the consecutive playouts.
void EventLogAnalyzer::CreatePlayoutGraph(Plot* plot) {
std::map<uint32_t, TimeSeries> time_series;

Powered by Google App Engine
This is Rietveld 408576698