Add lower/upper link capacity to the outgoing bitrate graph.

Bug: webrtc:14273
Change-Id: I8d9f1ac0d41b74a226abdff00f420d6b0624b73c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250442
Commit-Queue: Diep Bui <diepbp@google.com>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37557}
This commit is contained in:
Diep Bui 2022-07-19 14:09:45 +02:00 committed by WebRTC LUCI CQ
parent 7d4116855a
commit 38b3cf0223
3 changed files with 39 additions and 5 deletions

View file

@ -882,9 +882,11 @@ void EventLogAnalyzer::CreateTotalIncomingBitrateGraph(Plot* plot) {
}
// Plot the total bandwidth used by all RTP streams.
void EventLogAnalyzer::CreateTotalOutgoingBitrateGraph(Plot* plot,
void EventLogAnalyzer::CreateTotalOutgoingBitrateGraph(
Plot* plot,
bool show_detector_state,
bool show_alr_state) {
bool show_alr_state,
bool show_link_capacity) {
// TODO(terelius): This could be provided by the parser.
std::multimap<Timestamp, size_t> packets_in_order;
for (const auto& stream : parsed_log_.outgoing_rtp_packets_by_ssrc()) {
@ -930,6 +932,24 @@ void EventLogAnalyzer::CreateTotalOutgoingBitrateGraph(Plot* plot,
loss_series.points.emplace_back(x, y);
}
TimeSeries link_capacity_lower_series("Link-capacity-lower",
LineStyle::kStep);
TimeSeries link_capacity_upper_series("Link-capacity-upper",
LineStyle::kStep);
for (auto& remote_estimate_event : parsed_log_.remote_estimate_events()) {
float x = config_.GetCallTimeSec(remote_estimate_event.log_time());
if (remote_estimate_event.link_capacity_lower.has_value()) {
float link_capacity_lower = static_cast<float>(
remote_estimate_event.link_capacity_lower.value().kbps());
link_capacity_lower_series.points.emplace_back(x, link_capacity_lower);
}
if (remote_estimate_event.link_capacity_upper.has_value()) {
float link_capacity_upper = static_cast<float>(
remote_estimate_event.link_capacity_upper.value().kbps());
link_capacity_upper_series.points.emplace_back(x, link_capacity_upper);
}
}
TimeSeries delay_series("Delay-based estimate", LineStyle::kStep);
IntervalSeries overusing_series("Overusing", "#ff8e82",
IntervalSeries::kHorizontal);
@ -1026,6 +1046,12 @@ void EventLogAnalyzer::CreateTotalOutgoingBitrateGraph(Plot* plot,
if (show_alr_state) {
plot->AppendIntervalSeries(std::move(alr_state));
}
if (show_link_capacity) {
plot->AppendTimeSeriesIfNotEmpty(std::move(link_capacity_lower_series));
plot->AppendTimeSeriesIfNotEmpty(std::move(link_capacity_upper_series));
}
plot->AppendTimeSeries(std::move(loss_series));
plot->AppendTimeSeriesIfNotEmpty(std::move(probe_failures_series));
plot->AppendTimeSeries(std::move(delay_series));

View file

@ -59,7 +59,8 @@ class EventLogAnalyzer {
void CreateTotalIncomingBitrateGraph(Plot* plot);
void CreateTotalOutgoingBitrateGraph(Plot* plot,
bool show_detector_state = false,
bool show_alr_state = false);
bool show_alr_state = false,
bool show_link_capacity = false);
void CreateStreamBitrateGraph(PacketDirection direction, Plot* plot);
void CreateBitrateAllocationGraph(PacketDirection direction, Plot* plot);

View file

@ -69,6 +69,12 @@ ABSL_FLAG(bool,
false,
"Show the state ALR state on the total bitrate graph");
ABSL_FLAG(bool,
show_link_capacity,
true,
"Show the lower and upper link capacity on the outgoing bitrate "
"graph");
ABSL_FLAG(bool,
parse_unconfigured_header_extensions,
true,
@ -337,7 +343,8 @@ int main(int argc, char* argv[]) {
plots.RegisterPlot("outgoing_bitrate", [&](Plot* plot) {
analyzer.CreateTotalOutgoingBitrateGraph(
plot, absl::GetFlag(FLAGS_show_detector_state),
absl::GetFlag(FLAGS_show_alr_state));
absl::GetFlag(FLAGS_show_alr_state),
absl::GetFlag(FLAGS_show_link_capacity));
});
plots.RegisterPlot("incoming_stream_bitrate", [&](Plot* plot) {
analyzer.CreateStreamBitrateGraph(webrtc::kIncomingPacket, plot);