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

Unified Diff: webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.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_logging.cc
diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc
index 43818b08ca504cc090b11768116b79c3faed9666..12042a834d477cd6a8a943ccace8eb7330a04770 100644
--- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc
+++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc
@@ -18,6 +18,7 @@
#include <algorithm>
#include <sstream>
+#include "webrtc/base/format_macros.h"
#include "webrtc/base/platform_thread.h"
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
@@ -90,19 +91,26 @@ void Logging::Log(const char format[], ...) {
}
}
-void Logging::Plot(int figure, double value) {
- Plot(figure, value, 0, "-");
+void Logging::Plot(int figure, const std::string& name, double value) {
+ Plot(figure, name, value, 0, "-");
}
-void Logging::Plot(int figure, double value, uint32_t ssrc) {
- Plot(figure, value, ssrc, "-");
+void Logging::Plot(int figure,
+ const std::string& name,
+ double value,
+ uint32_t ssrc) {
+ Plot(figure, name, value, ssrc, "-");
}
-void Logging::Plot(int figure, double value, const std::string& alg_name) {
- Plot(figure, value, 0, alg_name);
+void Logging::Plot(int figure,
+ const std::string& name,
+ double value,
+ const std::string& alg_name) {
+ Plot(figure, name, value, 0, alg_name);
}
void Logging::Plot(int figure,
+ const std::string& name,
double value,
uint32_t ssrc,
const std::string& alg_name) {
@@ -110,20 +118,9 @@ void Logging::Plot(int figure,
ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId());
assert(it != thread_map_.end());
const State& state = it->second.stack.top();
- std::stringstream ss;
- ss << ssrc;
- std::string label = state.tag + ':' + ss.str() + '@' + alg_name;
- std::string prefix("Available");
- if (alg_name.compare(0, prefix.length(), prefix) == 0) {
- std::string receiver("Receiver");
- size_t start_pos = label.find(receiver);
- if (start_pos != std::string::npos) {
- label.replace(start_pos, receiver.length(), "Sender");
- }
- }
if (state.enabled) {
- printf("PLOT\t%d\t%s\t%f\t%f\n", figure, label.c_str(),
- state.timestamp_ms * 0.001, value);
+ printf("PLOT\t%d\t%s:%" PRIu32 "@%s\t%f\t%f\n", figure, name.c_str(), ssrc,
+ alg_name.c_str(), state.timestamp_ms * 0.001, value);
}
}

Powered by Google App Engine
This is Rietveld 408576698