perf_tests: Fixup perf test result printing format

Results should be printed METRIC: STORY, not the other way around.
Also, story names shouldn't have slashes as it will parse as separate
chart segments and won't be allowed when we switch to using histograms.

Bug: dawn:208, dawn:311
Change-Id: Ifc893e5aa94eddcb3a08c0d4aff66b7a0f41620b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14740
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Austin Eng 2019-12-20 19:10:50 +00:00 committed by Commit Bot service account
parent cd1152fb9b
commit e9b15ab829
2 changed files with 20 additions and 15 deletions

View File

@ -381,30 +381,30 @@ void DawnPerfTestBase::PrintResult(const std::string& trace,
double value,
const std::string& units,
bool important) const {
const ::testing::TestInfo* const testInfo =
::testing::UnitTest::GetInstance()->current_test_info();
const char* testName = testInfo->name();
const char* testSuite = testInfo->test_suite_name();
// The results are printed according to the format specified at
// [chromium]//build/scripts/slave/performance_log_processor.py
dawn::InfoLog() << (important ? "*" : "") << "RESULT " << testSuite << testName << ": " << trace
<< "= " << value << " " << units;
PrintResultImpl(trace, std::to_string(value), units, important);
}
void DawnPerfTestBase::PrintResult(const std::string& trace,
unsigned int value,
const std::string& units,
bool important) const {
PrintResultImpl(trace, std::to_string(value), units, important);
}
void DawnPerfTestBase::PrintResultImpl(const std::string& trace,
const std::string& value,
const std::string& units,
bool important) const {
const ::testing::TestInfo* const testInfo =
::testing::UnitTest::GetInstance()->current_test_info();
const char* testName = testInfo->name();
const char* testSuite = testInfo->test_suite_name();
std::string metric = std::string(testInfo->test_suite_name()) + "." + trace;
std::string story = testInfo->name();
std::replace(story.begin(), story.end(), '/', '_');
// The results are printed according to the format specified at
// [chromium]//build/scripts/slave/performance_log_processor.py
dawn::InfoLog() << (important ? "*" : "") << "RESULT " << testSuite << testName << ": " << trace
<< "= " << value << " " << units;
// [chromium]//src/tools/perf/generate_legacy_perf_dashboard_json.py
dawn::InfoLog() << (important ? "*" : "") << "RESULT " << metric << ": " << story << "= "
<< value << " " << units;
}

View File

@ -91,6 +91,11 @@ class DawnPerfTestBase {
void DoRunLoop(double maxRunTime);
void OutputResults();
void PrintResultImpl(const std::string& trace,
const std::string& value,
const std::string& units,
bool important) const;
virtual void Step() = 0;
DawnTestBase* mTest;