From 6a82207e4e77f458f55421880b312bc480336c36 Mon Sep 17 00:00:00 2001 From: Edward Lemur Date: Wed, 22 Nov 2017 19:17:50 +0100 Subject: [PATCH] Make PrintResult receive a double instead of a string. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It will be easier to make perf results output to JSON if the PrintResult* functions receive doubles instead of strings. I'll make follow-up CLs for PrintResultMeanAndError and PrintResultList. Bug: webrtc:8566 Change-Id: I198e422a7bb8cd237c6364af98d2f67f0858452e Reviewed-on: https://webrtc-review.googlesource.com/25300 Reviewed-by: Patrik Höglund Reviewed-by: Björn Terelius Commit-Queue: Edward Lemur Cr-Commit-Position: refs/heads/master@{#20848} --- modules/remote_bitrate_estimator/test/bwe_test.cc | 6 +++--- test/testsupport/perf_test.cc | 12 +----------- test/testsupport/perf_test.h | 11 +---------- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/modules/remote_bitrate_estimator/test/bwe_test.cc b/modules/remote_bitrate_estimator/test/bwe_test.cc index e998d8f4c3..f5fe38ee65 100644 --- a/modules/remote_bitrate_estimator/test/bwe_test.cc +++ b/modules/remote_bitrate_estimator/test/bwe_test.cc @@ -217,10 +217,10 @@ void BweTest::PrintResults(double max_throughput_kbps, double utilization = throughput_kbps.GetMean() / max_throughput_kbps; webrtc::test::PrintResult("BwePerformance", GetTestName(), "Utilization", utilization * 100.0, "%", false); + webrtc::test::PrintResult( + "BwePerformance", GetTestName(), "Utilization var coeff", + throughput_kbps.GetStdDev() / throughput_kbps.GetMean(), "", false); std::stringstream ss; - ss << throughput_kbps.GetStdDev() / throughput_kbps.GetMean(); - webrtc::test::PrintResult("BwePerformance", GetTestName(), - "Utilization var coeff", ss.str(), "", false); for (auto& kv : flow_throughput_kbps) { ss.str(""); ss << "Throughput flow " << kv.first; diff --git a/test/testsupport/perf_test.cc b/test/testsupport/perf_test.cc index 9a39b186d1..e8608cdf77 100644 --- a/test/testsupport/perf_test.cc +++ b/test/testsupport/perf_test.cc @@ -63,7 +63,7 @@ namespace test { void PrintResult(const std::string& measurement, const std::string& modifier, const std::string& trace, - size_t value, + const double value, const std::string& units, bool important) { std::ostringstream value_stream; @@ -72,16 +72,6 @@ void PrintResult(const std::string& measurement, units, important); } -void PrintResult(const std::string& measurement, - const std::string& modifier, - const std::string& trace, - const std::string& value, - const std::string& units, - bool important) { - PrintResultsImpl(measurement, modifier, trace, value, "", "", units, - important); -} - void PrintResultMeanAndError(const std::string& measurement, const std::string& modifier, const std::string& trace, diff --git a/test/testsupport/perf_test.h b/test/testsupport/perf_test.h index e864bb8143..95bbf65dc1 100644 --- a/test/testsupport/perf_test.h +++ b/test/testsupport/perf_test.h @@ -37,16 +37,7 @@ namespace test { void PrintResult(const std::string& measurement, const std::string& modifier, const std::string& trace, - size_t value, - const std::string& units, - bool important); - -// Like the above version of PrintResult(), but takes a std::string value -// instead of a size_t. -void PrintResult(const std::string& measurement, - const std::string& modifier, - const std::string& trace, - const std::string& value, + const double value, const std::string& units, bool important);