Add new event type to RtcEventLog

Alr state is now logged by the pacer. To avoid confusion,
loopback tools will now create two separate rtc event
logs for sender and receiver calls.

Bug: webrtc:8287, webrtc:8588
Change-Id: Ib3e47d109c3a65a7ed069b9a613e6a08fe6a2f30
Reviewed-on: https://webrtc-review.googlesource.com/26880
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21084}
This commit is contained in:
Ilya Nikolaevskiy
2017-12-05 13:19:45 +01:00
committed by Commit Bot
parent 095c25d05a
commit a4259f6b66
22 changed files with 236 additions and 26 deletions

View File

@ -522,6 +522,10 @@ EventLogAnalyzer::EventLogAnalyzer(const ParsedRtcEventLog& log)
bwe_probe_result_events_.push_back(parsed_log_.GetBweProbeResult(i));
break;
}
case ParsedRtcEventLog::ALR_STATE_EVENT: {
alr_state_events_.push_back(parsed_log_.GetAlrState(i));
break;
}
case ParsedRtcEventLog::UNKNOWN_EVENT: {
break;
}
@ -968,7 +972,8 @@ void EventLogAnalyzer::CreateFractionLossGraph(Plot* plot) {
void EventLogAnalyzer::CreateTotalBitrateGraph(
PacketDirection desired_direction,
Plot* plot,
bool show_detector_state) {
bool show_detector_state,
bool show_alr_state) {
struct TimestampSize {
TimestampSize(uint64_t t, size_t s) : timestamp(t), size(s) {}
uint64_t timestamp;
@ -1089,12 +1094,36 @@ void EventLogAnalyzer::CreateTotalBitrateGraph(
}
}
IntervalSeries alr_state("ALR", "#555555", IntervalSeries::kHorizontal);
bool previously_in_alr = false;
int64_t alr_start = 0;
for (auto& alr : alr_state_events_) {
float y = ToCallTime(alr.timestamp);
if (!previously_in_alr && alr.in_alr) {
alr_start = alr.timestamp;
previously_in_alr = true;
} else if (previously_in_alr && !alr.in_alr) {
float x = ToCallTime(alr_start);
alr_state.intervals.emplace_back(x, y);
previously_in_alr = false;
}
}
if (previously_in_alr) {
float x = ToCallTime(alr_start);
float y = ToCallTime(end_time_);
alr_state.intervals.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));
}
if (show_alr_state) {
plot->AppendIntervalSeries(std::move(alr_state));
}
plot->AppendTimeSeries(std::move(loss_series));
plot->AppendTimeSeries(std::move(delay_series));
plot->AppendTimeSeries(std::move(created_series));