Make PrintResultMeanAndError receive two doubles instead of a string.
Bug: webrtc:8566 Change-Id: Ida925b030bff24275d34c0e888ee362e94c46b21 Reviewed-on: https://webrtc-review.googlesource.com/25540 Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org> Reviewed-by: Alex Loiko <aleloi@webrtc.org> Reviewed-by: Björn Terelius <terelius@webrtc.org> Commit-Queue: Edward Lemur <ehmaldonado@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20866}
This commit is contained in:
parent
3e189a6dc3
commit
f9d303c042
@ -260,22 +260,12 @@ class TimedThreadApiProcessor {
|
|||||||
void print_processor_statistics(const std::string& processor_name) const {
|
void print_processor_statistics(const std::string& processor_name) const {
|
||||||
const std::string modifier = "_api_call_duration";
|
const std::string modifier = "_api_call_duration";
|
||||||
|
|
||||||
// Lambda function for creating a test printout string.
|
|
||||||
auto create_mean_and_std_string = [](int64_t average,
|
|
||||||
int64_t standard_dev) {
|
|
||||||
std::string s = std::to_string(average);
|
|
||||||
s += ", ";
|
|
||||||
s += std::to_string(standard_dev);
|
|
||||||
return s;
|
|
||||||
};
|
|
||||||
|
|
||||||
const std::string sample_rate_name =
|
const std::string sample_rate_name =
|
||||||
"_" + std::to_string(simulation_config_->sample_rate_hz) + "Hz";
|
"_" + std::to_string(simulation_config_->sample_rate_hz) + "Hz";
|
||||||
|
|
||||||
webrtc::test::PrintResultMeanAndError(
|
webrtc::test::PrintResultMeanAndError(
|
||||||
"apm_timing", sample_rate_name, processor_name,
|
"apm_timing", sample_rate_name, processor_name,
|
||||||
create_mean_and_std_string(GetDurationAverage(),
|
GetDurationAverage(), GetDurationStandardDeviation(),
|
||||||
GetDurationStandardDeviation()),
|
|
||||||
"us", false);
|
"us", false);
|
||||||
|
|
||||||
if (kPrintAllDurations) {
|
if (kPrintAllDurations) {
|
||||||
|
|||||||
@ -32,13 +32,6 @@ const size_t kNumFramesToProcessAtWarmup = 300;
|
|||||||
const size_t kToTalNumFrames =
|
const size_t kToTalNumFrames =
|
||||||
kNumFramesToProcess + kNumFramesToProcessAtWarmup;
|
kNumFramesToProcess + kNumFramesToProcessAtWarmup;
|
||||||
|
|
||||||
std::string FormPerformanceMeasureString(const test::PerformanceTimer& timer) {
|
|
||||||
std::string s = std::to_string(timer.GetDurationAverage());
|
|
||||||
s += ", ";
|
|
||||||
s += std::to_string(timer.GetDurationStandardDeviation());
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RunStandaloneSubmodule(int sample_rate_hz, size_t num_channels) {
|
void RunStandaloneSubmodule(int sample_rate_hz, size_t num_channels) {
|
||||||
test::SimulatorBuffers buffers(sample_rate_hz, sample_rate_hz, sample_rate_hz,
|
test::SimulatorBuffers buffers(sample_rate_hz, sample_rate_hz, sample_rate_hz,
|
||||||
sample_rate_hz, num_channels, num_channels,
|
sample_rate_hz, num_channels, num_channels,
|
||||||
@ -63,8 +56,8 @@ void RunStandaloneSubmodule(int sample_rate_hz, size_t num_channels) {
|
|||||||
"level_controller_call_durations",
|
"level_controller_call_durations",
|
||||||
"_" + std::to_string(sample_rate_hz) + "Hz_" +
|
"_" + std::to_string(sample_rate_hz) + "Hz_" +
|
||||||
std::to_string(num_channels) + "_channels",
|
std::to_string(num_channels) + "_channels",
|
||||||
"StandaloneLevelControl", FormPerformanceMeasureString(timer), "us",
|
"StandaloneLevelControl", timer.GetDurationAverage(),
|
||||||
false);
|
timer.GetDurationStandardDeviation(), "us", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunTogetherWithApm(const std::string& test_description,
|
void RunTogetherWithApm(const std::string& test_description,
|
||||||
@ -164,8 +157,8 @@ void RunTogetherWithApm(const std::string& test_description,
|
|||||||
std::to_string(capture_input_sample_rate_hz) + "_" +
|
std::to_string(capture_input_sample_rate_hz) + "_" +
|
||||||
std::to_string(capture_output_sample_rate_hz) + "Hz_" +
|
std::to_string(capture_output_sample_rate_hz) + "Hz_" +
|
||||||
std::to_string(num_channels) + "_channels" + "_render",
|
std::to_string(num_channels) + "_channels" + "_render",
|
||||||
test_description, FormPerformanceMeasureString(render_timer), "us",
|
test_description, render_timer.GetDurationAverage(),
|
||||||
false);
|
render_timer.GetDurationStandardDeviation(), "us", false);
|
||||||
webrtc::test::PrintResultMeanAndError(
|
webrtc::test::PrintResultMeanAndError(
|
||||||
"level_controller_call_durations",
|
"level_controller_call_durations",
|
||||||
"_" + std::to_string(render_input_sample_rate_hz) + "_" +
|
"_" + std::to_string(render_input_sample_rate_hz) + "_" +
|
||||||
@ -173,8 +166,8 @@ void RunTogetherWithApm(const std::string& test_description,
|
|||||||
std::to_string(capture_input_sample_rate_hz) + "_" +
|
std::to_string(capture_input_sample_rate_hz) + "_" +
|
||||||
std::to_string(capture_output_sample_rate_hz) + "Hz_" +
|
std::to_string(capture_output_sample_rate_hz) + "Hz_" +
|
||||||
std::to_string(num_channels) + "_channels" + "_capture",
|
std::to_string(num_channels) + "_channels" + "_capture",
|
||||||
test_description, FormPerformanceMeasureString(capture_timer), "us",
|
test_description, capture_timer.GetDurationAverage(),
|
||||||
false);
|
capture_timer.GetDurationStandardDeviation(), "us", false);
|
||||||
webrtc::test::PrintResultMeanAndError(
|
webrtc::test::PrintResultMeanAndError(
|
||||||
"level_controller_call_durations",
|
"level_controller_call_durations",
|
||||||
"_" + std::to_string(render_input_sample_rate_hz) + "_" +
|
"_" + std::to_string(render_input_sample_rate_hz) + "_" +
|
||||||
@ -182,7 +175,8 @@ void RunTogetherWithApm(const std::string& test_description,
|
|||||||
std::to_string(capture_input_sample_rate_hz) + "_" +
|
std::to_string(capture_input_sample_rate_hz) + "_" +
|
||||||
std::to_string(capture_output_sample_rate_hz) + "Hz_" +
|
std::to_string(capture_output_sample_rate_hz) + "Hz_" +
|
||||||
std::to_string(num_channels) + "_channels" + "_total",
|
std::to_string(num_channels) + "_channels" + "_total",
|
||||||
test_description, FormPerformanceMeasureString(total_timer), "us", false);
|
test_description, total_timer.GetDurationAverage(),
|
||||||
|
total_timer.GetDurationStandardDeviation(), "us", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@ -37,16 +37,6 @@ constexpr size_t kNumberOfWarmupMeasurementsStandalone =
|
|||||||
constexpr int kSampleRate = AudioProcessing::kSampleRate48kHz;
|
constexpr int kSampleRate = AudioProcessing::kSampleRate48kHz;
|
||||||
constexpr int kNumberOfChannels = 1;
|
constexpr int kNumberOfChannels = 1;
|
||||||
|
|
||||||
std::string FormPerformanceMeasureString(const test::PerformanceTimer& timer,
|
|
||||||
int number_of_warmup_samples) {
|
|
||||||
std::string s =
|
|
||||||
std::to_string(timer.GetDurationAverage(number_of_warmup_samples));
|
|
||||||
s += ", ";
|
|
||||||
s += std::to_string(
|
|
||||||
timer.GetDurationStandardDeviation(number_of_warmup_samples));
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RunStandaloneSubmodule() {
|
void RunStandaloneSubmodule() {
|
||||||
test::SimulatorBuffers buffers(
|
test::SimulatorBuffers buffers(
|
||||||
kSampleRate, kSampleRate, kSampleRate, kSampleRate, kNumberOfChannels,
|
kSampleRate, kSampleRate, kSampleRate, kSampleRate, kNumberOfChannels,
|
||||||
@ -84,8 +74,8 @@ void RunStandaloneSubmodule() {
|
|||||||
EXPECT_EQ(0.0f, sum);
|
EXPECT_EQ(0.0f, sum);
|
||||||
webrtc::test::PrintResultMeanAndError(
|
webrtc::test::PrintResultMeanAndError(
|
||||||
"echo_detector_call_durations", "", "StandaloneEchoDetector",
|
"echo_detector_call_durations", "", "StandaloneEchoDetector",
|
||||||
FormPerformanceMeasureString(timer,
|
timer.GetDurationAverage(kNumberOfWarmupMeasurementsStandalone),
|
||||||
kNumberOfWarmupMeasurementsStandalone),
|
timer.GetDurationStandardDeviation(kNumberOfWarmupMeasurementsStandalone),
|
||||||
"us", false);
|
"us", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +158,8 @@ void RunTogetherWithApm(const std::string& test_description,
|
|||||||
|
|
||||||
webrtc::test::PrintResultMeanAndError(
|
webrtc::test::PrintResultMeanAndError(
|
||||||
"echo_detector_call_durations", "_total", test_description,
|
"echo_detector_call_durations", "_total", test_description,
|
||||||
FormPerformanceMeasureString(timer, kNumberOfWarmupMeasurements), "us",
|
timer.GetDurationAverage(kNumberOfWarmupMeasurements),
|
||||||
|
timer.GetDurationStandardDeviation(kNumberOfWarmupMeasurements), "us",
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -225,15 +225,15 @@ void BweTest::PrintResults(double max_throughput_kbps,
|
|||||||
ss.str("");
|
ss.str("");
|
||||||
ss << "Throughput flow " << kv.first;
|
ss << "Throughput flow " << kv.first;
|
||||||
webrtc::test::PrintResultMeanAndError("BwePerformance", GetTestName(),
|
webrtc::test::PrintResultMeanAndError("BwePerformance", GetTestName(),
|
||||||
ss.str(), kv.second.AsString(),
|
ss.str(), kv.second.GetMean(),
|
||||||
"kbps", false);
|
kv.second.GetStdDev(), "kbps", false);
|
||||||
}
|
}
|
||||||
for (auto& kv : flow_delay_ms) {
|
for (auto& kv : flow_delay_ms) {
|
||||||
ss.str("");
|
ss.str("");
|
||||||
ss << "Delay flow " << kv.first;
|
ss << "Delay flow " << kv.first;
|
||||||
webrtc::test::PrintResultMeanAndError("BwePerformance", GetTestName(),
|
webrtc::test::PrintResultMeanAndError("BwePerformance", GetTestName(),
|
||||||
ss.str(), kv.second.AsString(), "ms",
|
ss.str(), kv.second.GetMean(),
|
||||||
false);
|
kv.second.GetStdDev(), "ms", false);
|
||||||
}
|
}
|
||||||
double fairness_index = 1.0;
|
double fairness_index = 1.0;
|
||||||
if (!flow_throughput_kbps.empty()) {
|
if (!flow_throughput_kbps.empty()) {
|
||||||
|
|||||||
@ -75,11 +75,14 @@ void PrintResult(const std::string& measurement,
|
|||||||
void PrintResultMeanAndError(const std::string& measurement,
|
void PrintResultMeanAndError(const std::string& measurement,
|
||||||
const std::string& modifier,
|
const std::string& modifier,
|
||||||
const std::string& trace,
|
const std::string& trace,
|
||||||
const std::string& mean_and_error,
|
const double mean,
|
||||||
|
const double error,
|
||||||
const std::string& units,
|
const std::string& units,
|
||||||
bool important) {
|
bool important) {
|
||||||
PrintResultsImpl(measurement, modifier, trace, mean_and_error,
|
std::ostringstream value_stream;
|
||||||
"{", "}", units, important);
|
value_stream << '{' << mean << ',' << error << '}';
|
||||||
|
PrintResultsImpl(measurement, modifier, trace, value_stream.str(), "", "",
|
||||||
|
units, important);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintResultList(const std::string& measurement,
|
void PrintResultList(const std::string& measurement,
|
||||||
|
|||||||
@ -47,7 +47,8 @@ void PrintResult(const std::string& measurement,
|
|||||||
void PrintResultMeanAndError(const std::string& measurement,
|
void PrintResultMeanAndError(const std::string& measurement,
|
||||||
const std::string& modifier,
|
const std::string& modifier,
|
||||||
const std::string& trace,
|
const std::string& trace,
|
||||||
const std::string& mean_and_error,
|
const double mean,
|
||||||
|
const double error,
|
||||||
const std::string& units,
|
const std::string& units,
|
||||||
bool important);
|
bool important);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user