Add ability to export internal state of SamplesStatsCounter.

Add ability to export internal state of SamplesStatsCounter to be able
then to plot that data.

Bug: webrtc:10138
Change-Id: I5aae5b7dea2989e9f82820933a9ab6f21db17556
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152542
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29173}
This commit is contained in:
Artem Titov
2019-09-12 20:30:54 +02:00
committed by Commit Bot
parent cc46b10cd0
commit 087be5cfd4
5 changed files with 107 additions and 5 deletions

View File

@ -70,6 +70,14 @@ ABSL_FLAG(
"https://github.com/catapult-project/catapult/blob/master/dashboard/docs/"
"data-format.md.");
constexpr char kPlotAllMetrics[] = "all";
ABSL_FLAG(std::vector<std::string>,
plot,
{},
"List of metrics that should be exported for plotting (if they are "
"available). Example: psnr,ssim,encode_time. To plot all available "
" metrics pass 'all' as flag value");
#endif
ABSL_FLAG(bool, logs, true, "print logs to stderr");
@ -166,6 +174,14 @@ class TestMainImpl : public TestMain {
if (!chartjson_result_file.empty()) {
webrtc::test::WritePerfResults(chartjson_result_file);
}
std::vector<std::string> metrics_to_plot = absl::GetFlag(FLAGS_plot);
if (!metrics_to_plot.empty()) {
if (metrics_to_plot.size() == 1 &&
metrics_to_plot[0] == kPlotAllMetrics) {
metrics_to_plot.clear();
}
webrtc::test::PrintPlottableResults(metrics_to_plot);
}
std::string result_filename =
absl::GetFlag(FLAGS_isolated_script_test_output);