mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Set chart id in WebRTC event log bindings.
Bug: None Change-Id: Ibf3a8fdfa85c4c7d7b9e73393057827b544ab3e5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325063 Commit-Queue: Björn Terelius <terelius@webrtc.org> Reviewed-by: Jeremy Leconte <jleconte@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41011}
This commit is contained in:
parent
a01529f334
commit
b9b4609747
5 changed files with 47 additions and 19 deletions
|
@ -76,43 +76,53 @@ void analyze_rtc_event_log(const char* log_contents,
|
|||
|
||||
// Outgoing
|
||||
if (absl::StrContains(selection_view, "outgoing_packet_sizes")) {
|
||||
analyzer.CreatePacketGraph(PacketDirection::kOutgoingPacket,
|
||||
collection.AppendNewPlot());
|
||||
analyzer.CreatePacketGraph(
|
||||
PacketDirection::kOutgoingPacket,
|
||||
collection.AppendNewPlot("outgoing_packet_sizes"));
|
||||
}
|
||||
if (absl::StrContains(selection_view, "outgoing_stream_bitrate")) {
|
||||
analyzer.CreateStreamBitrateGraph(PacketDirection::kOutgoingPacket,
|
||||
collection.AppendNewPlot());
|
||||
analyzer.CreateStreamBitrateGraph(
|
||||
PacketDirection::kOutgoingPacket,
|
||||
collection.AppendNewPlot("outgoing_stream_bitrate"));
|
||||
}
|
||||
if (absl::StrContains(selection_view, "outgoing_bitrate")) {
|
||||
analyzer.CreateTotalOutgoingBitrateGraph(collection.AppendNewPlot(),
|
||||
/*show_detector_state*/ true,
|
||||
/*show_alr_state*/ false,
|
||||
/*show_link_capacity*/ true);
|
||||
analyzer.CreateTotalOutgoingBitrateGraph(
|
||||
collection.AppendNewPlot("outgoing_bitrate"),
|
||||
/*show_detector_state*/ true,
|
||||
/*show_alr_state*/ false,
|
||||
/*show_link_capacity*/ true);
|
||||
}
|
||||
if (absl::StrContains(selection_view, "network_delay_feedback")) {
|
||||
analyzer.CreateNetworkDelayFeedbackGraph(collection.AppendNewPlot());
|
||||
analyzer.CreateNetworkDelayFeedbackGraph(
|
||||
collection.AppendNewPlot("network_delay_feedback"));
|
||||
}
|
||||
if (absl::StrContains(selection_view, "fraction_loss_feedback")) {
|
||||
analyzer.CreateFractionLossGraph(collection.AppendNewPlot());
|
||||
analyzer.CreateFractionLossGraph(
|
||||
collection.AppendNewPlot("fraction_loss_feedback"));
|
||||
}
|
||||
|
||||
// Incoming
|
||||
if (absl::StrContains(selection_view, "incoming_packet_sizes")) {
|
||||
analyzer.CreatePacketGraph(PacketDirection::kIncomingPacket,
|
||||
collection.AppendNewPlot());
|
||||
analyzer.CreatePacketGraph(
|
||||
PacketDirection::kIncomingPacket,
|
||||
collection.AppendNewPlot("incoming_packet_sizes"));
|
||||
}
|
||||
if (absl::StrContains(selection_view, "incoming_stream_bitrate")) {
|
||||
analyzer.CreateStreamBitrateGraph(PacketDirection::kIncomingPacket,
|
||||
collection.AppendNewPlot());
|
||||
analyzer.CreateStreamBitrateGraph(
|
||||
PacketDirection::kIncomingPacket,
|
||||
collection.AppendNewPlot("incoming_stream_bitrate"));
|
||||
}
|
||||
if (absl::StrContains(selection_view, "incoming_bitrate")) {
|
||||
analyzer.CreateTotalIncomingBitrateGraph(collection.AppendNewPlot());
|
||||
analyzer.CreateTotalIncomingBitrateGraph(
|
||||
collection.AppendNewPlot("incoming_bitrate"));
|
||||
}
|
||||
if (absl::StrContains(selection_view, "incoming_delay")) {
|
||||
analyzer.CreateIncomingDelayGraph(collection.AppendNewPlot());
|
||||
analyzer.CreateIncomingDelayGraph(
|
||||
collection.AppendNewPlot("incoming_delay"));
|
||||
}
|
||||
if (absl::StrContains(selection_view, "incoming_loss_rate")) {
|
||||
analyzer.CreateIncomingPacketLossGraph(collection.AppendNewPlot());
|
||||
analyzer.CreateIncomingPacketLossGraph(
|
||||
collection.AppendNewPlot("incoming_loss_rate"));
|
||||
}
|
||||
|
||||
webrtc::analytics::ChartCollection proto_charts;
|
||||
|
|
|
@ -65,4 +65,10 @@ TEST(RtcEventLogAnalyzerBindingsTest, ProducesCharts) {
|
|||
::testing::UnorderedElementsAre(
|
||||
"Outgoing RTP bitrate",
|
||||
"Outgoing network delay (based on per-packet feedback)"));
|
||||
std::vector<std::string> chart_ids;
|
||||
for (const auto& chart : collection.charts()) {
|
||||
chart_ids.push_back(chart.id());
|
||||
}
|
||||
EXPECT_THAT(chart_ids, ::testing::UnorderedElementsAre(
|
||||
"outgoing_bitrate", "network_delay_feedback"));
|
||||
}
|
||||
|
|
|
@ -613,9 +613,8 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
for (const auto& plot : plots) {
|
||||
if (plot.enabled) {
|
||||
Plot* output = collection.AppendNewPlot();
|
||||
Plot* output = collection.AppendNewPlot(plot.label);
|
||||
plot.plot_func(output);
|
||||
output->SetId(plot.label);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -80,6 +80,10 @@ void Plot::SetId(const std::string& id) {
|
|||
id_ = id;
|
||||
}
|
||||
|
||||
void Plot::SetId(absl::string_view id) {
|
||||
id_ = id;
|
||||
}
|
||||
|
||||
void Plot::AppendTimeSeries(TimeSeries&& time_series) {
|
||||
series_list_.emplace_back(std::move(time_series));
|
||||
}
|
||||
|
@ -338,4 +342,10 @@ Plot* PlotCollection::AppendNewPlot() {
|
|||
return plots_.back().get();
|
||||
}
|
||||
|
||||
Plot* PlotCollection::AppendNewPlot(absl::string_view chart_id) {
|
||||
plots_.push_back(std::make_unique<Plot>());
|
||||
plots_.back()->SetId(chart_id);
|
||||
return plots_.back().get();
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -156,6 +156,7 @@ class Plot {
|
|||
// the title might change in future releases whereas the ID should be stable
|
||||
// over time.
|
||||
void SetId(const std::string& id);
|
||||
void SetId(absl::string_view id);
|
||||
|
||||
// Add a new TimeSeries to the plot.
|
||||
void AppendTimeSeries(TimeSeries&& time_series);
|
||||
|
@ -197,6 +198,8 @@ class PlotCollection {
|
|||
|
||||
virtual Plot* AppendNewPlot();
|
||||
|
||||
virtual Plot* AppendNewPlot(absl::string_view);
|
||||
|
||||
void SetCallTimeToUtcOffsetMs(int64_t calltime_to_utc_ms) {
|
||||
calltime_to_utc_ms_ = calltime_to_utc_ms;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue