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

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

Issue 2295063006: Plot accumelated packets over time. (Closed)
Patch Set: data --> packets 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
« no previous file with comments | « webrtc/tools/event_log_visualizer/analyzer.h ('k') | webrtc/tools/event_log_visualizer/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7db82ae47806a4c262a9b7353d3869f160b30d2f 100644
--- a/webrtc/tools/event_log_visualizer/analyzer.cc
+++ b/webrtc/tools/event_log_visualizer/analyzer.cc
@@ -498,6 +498,53 @@ void EventLogAnalyzer::CreatePacketGraph(PacketDirection desired_direction,
}
}
+template <typename T>
+void EventLogAnalyzer::CreateAccumulatedPacketsTimeSeries(
+ PacketDirection desired_direction,
+ Plot* plot,
+ const std::map<StreamId, std::vector<T>>& packets,
+ const std::string& label_prefix) {
+ for (auto& kv : packets) {
+ StreamId stream_id = kv.first;
+ const std::vector<T>& 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 = label_prefix + " " + 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));
+ }
+}
+
+void EventLogAnalyzer::CreateAccumulatedPacketsGraph(
+ PacketDirection desired_direction,
+ Plot* plot) {
+ CreateAccumulatedPacketsTimeSeries(desired_direction, plot, rtp_packets_,
+ "RTP");
+ CreateAccumulatedPacketsTimeSeries(desired_direction, plot, rtcp_packets_,
+ "RTCP");
+
+ 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("Accumulated Incoming RTP/RTCP packets");
+ } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) {
+ plot->SetTitle("Accumulated 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;
« no previous file with comments | « webrtc/tools/event_log_visualizer/analyzer.h ('k') | webrtc/tools/event_log_visualizer/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698