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

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: IntervalSeries struct 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
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 a9fdce6059ca3f4fcf2ce942bfbc00dd25523159..ee7e9b53931464f92011cb4bf4d8482ca2366b73 100644
--- a/webrtc/rtc_tools/event_log_visualizer/analyzer.cc
+++ b/webrtc/rtc_tools/event_log_visualizer/analyzer.cc
@@ -292,7 +292,7 @@ void MovingAverage(
} // namespace
EventLogAnalyzer::EventLogAnalyzer(const ParsedRtcEventLog& log)
- : parsed_log_(log), window_duration_(250000), step_(10000) {
+ : parsed_log_(log), window_duration_(500000), step_(10000) {
uint64_t first_timestamp = std::numeric_limits<uint64_t>::max();
uint64_t last_timestamp = std::numeric_limits<uint64_t>::min();
@@ -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::kVertical);
+ IntervalSeries underusing_series("Underusing", "#5092fc",
+ IntervalSeries::kVertical);
+ IntervalSeries normal_series("Normal", "#c4ffc4",
+ IntervalSeries::kVertical);
+ 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(underusing_series));
+ plot->AppendIntervalSeries(std::move(normal_series));
+ plot->AppendIntervalSeries(std::move(overusing_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));

Powered by Google App Engine
This is Rietveld 408576698