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:
committed by
Commit Bot
parent
095c25d05a
commit
a4259f6b66
@ -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));
|
||||
|
||||
@ -87,7 +87,8 @@ class EventLogAnalyzer {
|
||||
|
||||
void CreateTotalBitrateGraph(PacketDirection desired_direction,
|
||||
Plot* plot,
|
||||
bool show_detector_state = false);
|
||||
bool show_detector_state = false,
|
||||
bool show_alr_state = false);
|
||||
|
||||
void CreateStreamBitrateGraph(PacketDirection desired_direction, Plot* plot);
|
||||
|
||||
@ -201,6 +202,8 @@ class EventLogAnalyzer {
|
||||
|
||||
std::vector<std::unique_ptr<TriageNotification>> notifications_;
|
||||
|
||||
std::vector<ParsedRtcEventLog::AlrStateEvent> alr_state_events_;
|
||||
|
||||
// Window and step size used for calculating moving averages, e.g. bitrate.
|
||||
// The generated data points will be |step_| microseconds apart.
|
||||
// Only events occuring at most |window_duration_| microseconds before the
|
||||
|
||||
@ -132,6 +132,10 @@ DEFINE_bool(show_detector_state,
|
||||
"Show the state of the delay based BWE detector on the total "
|
||||
"bitrate graph");
|
||||
|
||||
DEFINE_bool(show_alr_state,
|
||||
false,
|
||||
"Show the state ALR state on the total bitrate graph");
|
||||
|
||||
DEFINE_bool(
|
||||
print_triage_notifications,
|
||||
false,
|
||||
@ -245,12 +249,14 @@ int main(int argc, char* argv[]) {
|
||||
if (FLAG_plot_incoming_bitrate) {
|
||||
analyzer.CreateTotalBitrateGraph(webrtc::PacketDirection::kIncomingPacket,
|
||||
collection->AppendNewPlot(),
|
||||
FLAG_show_detector_state);
|
||||
FLAG_show_detector_state,
|
||||
FLAG_show_alr_state);
|
||||
}
|
||||
if (FLAG_plot_outgoing_bitrate) {
|
||||
analyzer.CreateTotalBitrateGraph(webrtc::PacketDirection::kOutgoingPacket,
|
||||
collection->AppendNewPlot(),
|
||||
FLAG_show_detector_state);
|
||||
FLAG_show_detector_state,
|
||||
FLAG_show_alr_state);
|
||||
}
|
||||
if (FLAG_plot_incoming_stream_bitrate) {
|
||||
analyzer.CreateStreamBitrateGraph(webrtc::PacketDirection::kIncomingPacket,
|
||||
|
||||
@ -103,8 +103,8 @@ void PythonPlot::Draw() {
|
||||
}
|
||||
|
||||
// IntervalSeries
|
||||
printf("interval_colors = ['#ff8e82','#5092fc','#c4ffc4']\n");
|
||||
RTC_CHECK_LE(interval_list_.size(), 3);
|
||||
printf("interval_colors = ['#ff8e82','#5092fc','#c4ffc4','#aaaaaa']\n");
|
||||
RTC_CHECK_LE(interval_list_.size(), 4);
|
||||
// To get the intervals to show up in the legend we have to create patches
|
||||
// for them.
|
||||
printf("legend_patches = []\n");
|
||||
|
||||
Reference in New Issue
Block a user