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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/rtc_tools/event_log_visualizer/analyzer.cc
diff --git a/webrtc/rtc_tools/event_log_visualizer/analyzer.cc b/webrtc/rtc_tools/event_log_visualizer/analyzer.cc
index 78993f4f7cada132678d8aa1456ea339285ee1d0..b42f0820f48dd878e8263dd03aaf51747769d74b 100644
--- a/webrtc/rtc_tools/event_log_visualizer/analyzer.cc
+++ b/webrtc/rtc_tools/event_log_visualizer/analyzer.cc
@@ -898,7 +898,8 @@ void EventLogAnalyzer::CreateFractionLossGraph(Plot* plot) {
// Plot the total bandwidth used by all RTP streams.
void EventLogAnalyzer::CreateTotalBitrateGraph(
PacketDirection desired_direction,
- Plot* plot) {
+ Plot* plot,
+ bool show_detector_state) {
struct TimestampSize {
TimestampSize(uint64_t t, size_t s) : timestamp(t), size(s) {}
uint64_t timestamp;
@@ -958,13 +959,46 @@ void EventLogAnalyzer::CreateTotalBitrateGraph(
}
TimeSeries delay_series("Delay-based estimate", LINE_STEP_GRAPH);
+ IntervalSeries overusing_series("Overusing", "#ff8e82",
+ IntervalSeries::kHorizontal);
+ IntervalSeries underusing_series("Underusing", "#5092fc",
+ IntervalSeries::kHorizontal);
+ IntervalSeries normal_series("Normal", "#c4ffc4",
+ IntervalSeries::kHorizontal);
+ IntervalSeries* last_series = &normal_series;
+ double last_detector_switch = 0.0;
+
+ BandwidthUsage last_detector_state = BandwidthUsage::kBwNormal;
+
for (auto& delay_update : bwe_delay_updates_) {
float x =
static_cast<float>(delay_update.timestamp - begin_time_) / 1000000;
float y = static_cast<float>(delay_update.bitrate_bps) / 1000;
+
+ if (last_detector_state != delay_update.detector_state) {
+ last_series->intervals.emplace_back(last_detector_switch, x);
+ last_detector_state = delay_update.detector_state;
+ last_detector_switch = x;
+
+ switch (delay_update.detector_state) {
+ case BandwidthUsage::kBwNormal:
+ last_series = &normal_series;
+ break;
+ case BandwidthUsage::kBwUnderusing:
+ last_series = &underusing_series;
+ break;
+ case BandwidthUsage::kBwOverusing:
+ last_series = &overusing_series;
+ break;
+ }
+ }
+
delay_series.points.emplace_back(x, y);
}
+ RTC_CHECK(last_series);
+ last_series->intervals.emplace_back(last_detector_switch, end_time_);
+
TimeSeries created_series("Probe cluster created.", DOT_GRAPH);
for (auto& cluster : bwe_probe_cluster_created_events_) {
float x = static_cast<float>(cluster.timestamp - begin_time_) / 1000000;
@@ -980,6 +1014,14 @@ void EventLogAnalyzer::CreateTotalBitrateGraph(
result_series.points.emplace_back(x, y);
}
}
+
+ if (show_detector_state) {
+ plot->AppendIntervalSeries(std::move(overusing_series));
+ plot->AppendIntervalSeries(std::move(underusing_series));
+ plot->AppendIntervalSeries(std::move(normal_series));
+ }
+
+ plot->AppendTimeSeries(std::move(bitrate_series));
plot->AppendTimeSeries(std::move(loss_series));
plot->AppendTimeSeries(std::move(delay_series));
plot->AppendTimeSeries(std::move(created_series));
« 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