Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(960)

Unified Diff: webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc

Issue 2456373002: Update BWE_TEST_LOGGING_PLOT output format, and fix plot_dynamics.py script. (Closed)
Patch Set: Suppress warnings about unused variable. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc
diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc
index a9fd617118a2c15d5caad50e91e616b736f27c3f..ac0e53d585435c02a5d07b8dfadd9bdfa09997b0 100644
--- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc
+++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc
@@ -217,42 +217,47 @@ uint32_t PacketProcessor::bits_per_second() const {
RateCounterFilter::RateCounterFilter(PacketProcessorListener* listener,
int flow_id,
const char* name,
- const std::string& plot_name)
+ const std::string& algorithm_name)
: PacketProcessor(listener, flow_id, kRegular),
packets_per_second_stats_(),
kbps_stats_(),
start_plotting_time_ms_(0),
- plot_name_(plot_name) {
- std::stringstream ss;
- ss << name << "_" << flow_id;
- name_ = ss.str();
-}
+ flow_id_(flow_id),
+ name_(name),
+ algorithm_name_(algorithm_name) {
+ // Only used when compiling with BWE test logging enabled.
+ RTC_UNUSED(flow_id_);
+ }
RateCounterFilter::RateCounterFilter(PacketProcessorListener* listener,
const FlowIds& flow_ids,
const char* name,
- const std::string& plot_name)
+ const std::string& algorithm_name)
: PacketProcessor(listener, flow_ids, kRegular),
packets_per_second_stats_(),
kbps_stats_(),
start_plotting_time_ms_(0),
- plot_name_(plot_name) {
+ flow_id_(0),
+ name_(name),
+ algorithm_name_(algorithm_name) {
+ // TODO(terelius): Appending the flow IDs to the algorithm name is a hack to
+ // keep the current plot functionality without having to print the full
+ // context for each PLOT line. It is unclear whether multiple flow IDs are
+ // needed at all in the long term.
std::stringstream ss;
- ss << name;
- char delimiter = '_';
+ ss << algorithm_name_;
for (int flow_id : flow_ids) {
- ss << delimiter << flow_id;
- delimiter = ',';
+ ss << ',' << flow_id;
}
- name_ = ss.str();
+ algorithm_name_ = ss.str();
}
RateCounterFilter::RateCounterFilter(PacketProcessorListener* listener,
const FlowIds& flow_ids,
const char* name,
int64_t start_plotting_time_ms,
- const std::string& plot_name)
- : RateCounterFilter(listener, flow_ids, name, plot_name) {
+ const std::string& algorithm_name)
+ : RateCounterFilter(listener, flow_ids, name, algorithm_name) {
start_plotting_time_ms_ = start_plotting_time_ms;
}
@@ -277,11 +282,13 @@ void RateCounterFilter::Plot(int64_t timestamp_ms) {
plot_kbps = rate_counter_.bits_per_second() / 1000.0;
}
BWE_TEST_LOGGING_CONTEXT(name_.c_str());
- if (plot_name_.empty()) {
- BWE_TEST_LOGGING_PLOT(0, "Throughput_kbps#1", timestamp_ms, plot_kbps);
+ if (algorithm_name_.empty()) {
+ BWE_TEST_LOGGING_PLOT_WITH_SSRC(0, "Throughput_kbps#1", timestamp_ms,
+ plot_kbps, flow_id_);
} else {
- BWE_TEST_LOGGING_PLOT_WITH_NAME(0, "Throughput_kbps#1", timestamp_ms,
- plot_kbps, plot_name_);
+ BWE_TEST_LOGGING_PLOT_WITH_NAME_AND_SSRC(0, "Throughput_kbps#1",
+ timestamp_ms, plot_kbps, flow_id_,
+ algorithm_name_);
}
RTC_UNUSED(plot_kbps);

Powered by Google App Engine
This is Rietveld 408576698