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) { |
terelius
2017/07/07 13:42:01
Changing this will make the curves less noisy, but
philipel
2017/07/11 14:12:35
Oops, this was not meant to be changed, reverted.
|
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); |
terelius
2017/07/07 13:42:01
Shouldn't this be "Horizontal"? You are trying to
philipel
2017/07/11 14:12:35
The area span vertically, but only in an interval
terelius
2017/07/11 14:45:11
Yes, but then it is a horizontal interval. Whether
philipel
2017/07/11 15:42:07
Ah, I see what you mean, fixed.
|
+ 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)); |