mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-04 12:16:10 +00:00
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:
parent
cd1152fb9b
commit
e9b15ab829
@ -381,30 +381,30 @@ void DawnPerfTestBase::PrintResult(const std::string& trace,
|
|||||||
double value,
|
double value,
|
||||||
const std::string& units,
|
const std::string& units,
|
||||||
bool important) const {
|
bool important) const {
|
||||||
const ::testing::TestInfo* const testInfo =
|
PrintResultImpl(trace, std::to_string(value), units, important);
|
||||||
::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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DawnPerfTestBase::PrintResult(const std::string& trace,
|
void DawnPerfTestBase::PrintResult(const std::string& trace,
|
||||||
unsigned int value,
|
unsigned int value,
|
||||||
const std::string& units,
|
const std::string& units,
|
||||||
bool important) const {
|
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 =
|
const ::testing::TestInfo* const testInfo =
|
||||||
::testing::UnitTest::GetInstance()->current_test_info();
|
::testing::UnitTest::GetInstance()->current_test_info();
|
||||||
|
|
||||||
const char* testName = testInfo->name();
|
std::string metric = std::string(testInfo->test_suite_name()) + "." + trace;
|
||||||
const char* testSuite = testInfo->test_suite_name();
|
|
||||||
|
std::string story = testInfo->name();
|
||||||
|
std::replace(story.begin(), story.end(), '/', '_');
|
||||||
|
|
||||||
// The results are printed according to the format specified at
|
// The results are printed according to the format specified at
|
||||||
// [chromium]//build/scripts/slave/performance_log_processor.py
|
// [chromium]//src/tools/perf/generate_legacy_perf_dashboard_json.py
|
||||||
dawn::InfoLog() << (important ? "*" : "") << "RESULT " << testSuite << testName << ": " << trace
|
dawn::InfoLog() << (important ? "*" : "") << "RESULT " << metric << ": " << story << "= "
|
||||||
<< "= " << value << " " << units;
|
<< value << " " << units;
|
||||||
}
|
}
|
||||||
|
@ -91,6 +91,11 @@ class DawnPerfTestBase {
|
|||||||
void DoRunLoop(double maxRunTime);
|
void DoRunLoop(double maxRunTime);
|
||||||
void OutputResults();
|
void OutputResults();
|
||||||
|
|
||||||
|
void PrintResultImpl(const std::string& trace,
|
||||||
|
const std::string& value,
|
||||||
|
const std::string& units,
|
||||||
|
bool important) const;
|
||||||
|
|
||||||
virtual void Step() = 0;
|
virtual void Step() = 0;
|
||||||
|
|
||||||
DawnTestBase* mTest;
|
DawnTestBase* mTest;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user