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

Side by Side Diff: webrtc/rtc_tools/event_log_visualizer/analyzer.cc

Issue 2826313004: Added -show_detector_state which show the detector state in the total bitrate graph. (Closed)
Patch Set: Intervals now show up in the legend. Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 891 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
892 plot->SetSuggestedYAxis(0, 10, "Percent lost packets", kBottomMargin, 892 plot->SetSuggestedYAxis(0, 10, "Percent lost packets", kBottomMargin,
893 kTopMargin); 893 kTopMargin);
894 plot->SetTitle("Reported packet loss"); 894 plot->SetTitle("Reported packet loss");
895 plot->AppendTimeSeries(std::move(time_series)); 895 plot->AppendTimeSeries(std::move(time_series));
896 } 896 }
897 897
898 // Plot the total bandwidth used by all RTP streams. 898 // Plot the total bandwidth used by all RTP streams.
899 void EventLogAnalyzer::CreateTotalBitrateGraph( 899 void EventLogAnalyzer::CreateTotalBitrateGraph(
900 PacketDirection desired_direction, 900 PacketDirection desired_direction,
901 Plot* plot) { 901 Plot* plot,
902 bool show_detector_state) {
902 struct TimestampSize { 903 struct TimestampSize {
903 TimestampSize(uint64_t t, size_t s) : timestamp(t), size(s) {} 904 TimestampSize(uint64_t t, size_t s) : timestamp(t), size(s) {}
904 uint64_t timestamp; 905 uint64_t timestamp;
905 size_t size; 906 size_t size;
906 }; 907 };
907 std::vector<TimestampSize> packets; 908 std::vector<TimestampSize> packets;
908 909
909 PacketDirection direction; 910 PacketDirection direction;
910 size_t total_length; 911 size_t total_length;
911 912
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 if (desired_direction == kOutgoingPacket) { 952 if (desired_direction == kOutgoingPacket) {
952 TimeSeries loss_series("Loss-based estimate", LINE_STEP_GRAPH); 953 TimeSeries loss_series("Loss-based estimate", LINE_STEP_GRAPH);
953 for (auto& loss_update : bwe_loss_updates_) { 954 for (auto& loss_update : bwe_loss_updates_) {
954 float x = 955 float x =
955 static_cast<float>(loss_update.timestamp - begin_time_) / 1000000; 956 static_cast<float>(loss_update.timestamp - begin_time_) / 1000000;
956 float y = static_cast<float>(loss_update.new_bitrate) / 1000; 957 float y = static_cast<float>(loss_update.new_bitrate) / 1000;
957 loss_series.points.emplace_back(x, y); 958 loss_series.points.emplace_back(x, y);
958 } 959 }
959 960
960 TimeSeries delay_series("Delay-based estimate", LINE_STEP_GRAPH); 961 TimeSeries delay_series("Delay-based estimate", LINE_STEP_GRAPH);
962 IntervalSeries overusing_series("Overusing", "#ff8e82",
963 IntervalSeries::kHorizontal);
964 IntervalSeries underusing_series("Underusing", "#5092fc",
965 IntervalSeries::kHorizontal);
966 IntervalSeries normal_series("Normal", "#c4ffc4",
967 IntervalSeries::kHorizontal);
968 IntervalSeries* last_series = &normal_series;
969 double last_detector_switch = 0.0;
970
971 BandwidthUsage last_detector_state = BandwidthUsage::kBwNormal;
972
961 for (auto& delay_update : bwe_delay_updates_) { 973 for (auto& delay_update : bwe_delay_updates_) {
962 float x = 974 float x =
963 static_cast<float>(delay_update.timestamp - begin_time_) / 1000000; 975 static_cast<float>(delay_update.timestamp - begin_time_) / 1000000;
964 float y = static_cast<float>(delay_update.bitrate_bps) / 1000; 976 float y = static_cast<float>(delay_update.bitrate_bps) / 1000;
977
978 if (last_detector_state != delay_update.detector_state) {
979 last_series->intervals.emplace_back(last_detector_switch, x);
980 last_detector_state = delay_update.detector_state;
981 last_detector_switch = x;
982
983 switch (delay_update.detector_state) {
984 case BandwidthUsage::kBwNormal:
985 last_series = &normal_series;
986 break;
987 case BandwidthUsage::kBwUnderusing:
988 last_series = &underusing_series;
989 break;
990 case BandwidthUsage::kBwOverusing:
991 last_series = &overusing_series;
992 break;
993 }
994 }
995
965 delay_series.points.emplace_back(x, y); 996 delay_series.points.emplace_back(x, y);
966 } 997 }
967 998
999 RTC_CHECK(last_series);
1000 last_series->intervals.emplace_back(last_detector_switch, end_time_);
1001
968 TimeSeries created_series("Probe cluster created.", DOT_GRAPH); 1002 TimeSeries created_series("Probe cluster created.", DOT_GRAPH);
969 for (auto& cluster : bwe_probe_cluster_created_events_) { 1003 for (auto& cluster : bwe_probe_cluster_created_events_) {
970 float x = static_cast<float>(cluster.timestamp - begin_time_) / 1000000; 1004 float x = static_cast<float>(cluster.timestamp - begin_time_) / 1000000;
971 float y = static_cast<float>(cluster.bitrate_bps) / 1000; 1005 float y = static_cast<float>(cluster.bitrate_bps) / 1000;
972 created_series.points.emplace_back(x, y); 1006 created_series.points.emplace_back(x, y);
973 } 1007 }
974 1008
975 TimeSeries result_series("Probing results.", DOT_GRAPH); 1009 TimeSeries result_series("Probing results.", DOT_GRAPH);
976 for (auto& result : bwe_probe_result_events_) { 1010 for (auto& result : bwe_probe_result_events_) {
977 if (result.bitrate_bps) { 1011 if (result.bitrate_bps) {
978 float x = static_cast<float>(result.timestamp - begin_time_) / 1000000; 1012 float x = static_cast<float>(result.timestamp - begin_time_) / 1000000;
979 float y = static_cast<float>(*result.bitrate_bps) / 1000; 1013 float y = static_cast<float>(*result.bitrate_bps) / 1000;
980 result_series.points.emplace_back(x, y); 1014 result_series.points.emplace_back(x, y);
981 } 1015 }
982 } 1016 }
1017
1018 if (show_detector_state) {
1019 plot->AppendIntervalSeries(std::move(overusing_series));
1020 plot->AppendIntervalSeries(std::move(underusing_series));
1021 plot->AppendIntervalSeries(std::move(normal_series));
1022 }
1023
1024 plot->AppendTimeSeries(std::move(bitrate_series));
983 plot->AppendTimeSeries(std::move(loss_series)); 1025 plot->AppendTimeSeries(std::move(loss_series));
984 plot->AppendTimeSeries(std::move(delay_series)); 1026 plot->AppendTimeSeries(std::move(delay_series));
985 plot->AppendTimeSeries(std::move(created_series)); 1027 plot->AppendTimeSeries(std::move(created_series));
986 plot->AppendTimeSeries(std::move(result_series)); 1028 plot->AppendTimeSeries(std::move(result_series));
987 } 1029 }
988 1030
989 // Overlay the incoming REMB over the outgoing bitrate 1031 // Overlay the incoming REMB over the outgoing bitrate
990 // and outgoing REMB over incoming bitrate. 1032 // and outgoing REMB over incoming bitrate.
991 PacketDirection remb_direction = 1033 PacketDirection remb_direction =
992 desired_direction == kOutgoingPacket ? kIncomingPacket : kOutgoingPacket; 1034 desired_direction == kOutgoingPacket ? kIncomingPacket : kOutgoingPacket;
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 plot->AppendTimeSeries(std::move(series.second)); 1711 plot->AppendTimeSeries(std::move(series.second));
1670 } 1712 }
1671 1713
1672 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1714 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1673 plot->SetYAxis(min_y_axis, max_y_axis, "Relative delay (ms)", kBottomMargin, 1715 plot->SetYAxis(min_y_axis, max_y_axis, "Relative delay (ms)", kBottomMargin,
1674 kTopMargin); 1716 kTopMargin);
1675 plot->SetTitle("NetEq timing"); 1717 plot->SetTitle("NetEq timing");
1676 } 1718 }
1677 } // namespace plotting 1719 } // namespace plotting
1678 } // namespace webrtc 1720 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/rtc_tools/event_log_visualizer/analyzer.h ('k') | webrtc/rtc_tools/event_log_visualizer/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698