BenchmarkRunner fixes and make it extensible#14670
BenchmarkRunner fixes and make it extensible#14670caithagoras merged 7 commits intoprestodb:masterfrom
Conversation
|
|
c2b99c1 to
95eb1a0
Compare
|
@yingsu00 Yes. Updated all commit messages. |
yingsu00
left a comment
There was a problem hiding this comment.
Make BenchmarkSuiteSupplier extensible LGTM with a tiny nit
Make benchmark runner extensible LGTM
Run out of time today. Will continue read tomorrow
...nner/src/test/java/com/facebook/presto/benchmark/source/TestMySqlBenchmarkSuiteSupplier.java
Outdated
Show resolved
Hide resolved
|
@yingsu00 Thanks. comments addressed. |
10c70f4 to
7103f33
Compare
|
Added a few more refactoring commits to prepare for supporting |
6830665 to
96294e7
Compare
|
@yingsu00 All tests added. |
yingsu00
left a comment
There was a problem hiding this comment.
Make max concurrency optional in ConcurrentExecutionPhase LGTM. Just add comment to define what STREAM/CONCURRENT means.
There was a problem hiding this comment.
Does STREAM mean single stream and CONCURRENT means multiple of streams? Or CONCURRENT means no streams? Could you add some comment?
yingsu00
left a comment
There was a problem hiding this comment.
Fix PhaseSpecification LGTM
There was a problem hiding this comment.
Why is the queries mutable? Everything else is final, why does the queries need to change given a fixed suite and querySet?
There was a problem hiding this comment.
Answered below.
There was a problem hiding this comment.
Same question as above: why do we need to use setQueries instead of make it part of the constructor?
There was a problem hiding this comment.
You can find that all fields of BenchmarkSuite are immutable. queries is mutable only in this JdbiBuilder inner-class.
Why do we need to use setQueries instead of make it part of the constructor?
This is because we need to run 2 MySQL queries to fetch all information about a suite.
dao.getBenchmarkSuitegets some the suite configuration by readingbenchmark_suites.dao.getBenchmarkQueriesgets the list of queries by readingbenchmark_queries.
The result of 1st query needs to be stored in some intermediate object. Before the refactoring, the result is mapped to BenchmarkSuiteInfo class, and a BenchmarkSuite contains both BenchmarkSuiteInfo and the query lists. With the refactoring, I removed BenchmarkSuiteInfo, and replace it with the builder class instead. The result of the 1st query is mapped to BenchmarkSuite.JdbiBuilder using the constructor, while the result of the 2nd query is added to the build using the setter. And finally JdbiBuilder.build() returns a BenchmarkSuite object.
There was a problem hiding this comment.
Why are all tests with empty session properties? Can we add some test with non-empty session properties?
|
@caithagoras any thoughts on the comments? |
- Move the logic of DbBenchmarkSuiteSupplier into an abastract base class AbstractJdbiBenchmarkSuiteSupplier. - Move MySqlBenchmarkSuiteConfig to the correct package.
Move logic from PrestoBenchmarkCommand to an abstract base class.
Fix JSON serialization and deserialization for subclasses of PhaseSpecification. It is unnecessay to make ExecutionStrategy a field or JSON field. Instead, ExecutionStrategy is static for any subclasses of PhaseExecution. Also, - Fix equals() and hashCode() - Move ExecutionStrategy to top-level
Remove BenchmarkSuiteInfo and move all its fields into BenchmarkSuite. Use a builder object of BenchmarkSuite to hold the intermediate suite information fetched from MySQL.
- Re-define interface PhaseExecutor so that a PhaseExecutor is a stateless object and is reused across phases. - Move BenchmarQueryRunner into AbstractPhaseExecutor. - Shutdown executor in a single place. - Post events in single places. - Move all classes in executor package to framework package.
Allow max concurrency for concurrent phases to be specified through config. - Use the max concurrency from config if specified. - Else, use the max concurrency specified in phase specification. - Else, use the default max concurrency 70.
|
@yingsu00 comments addressed |
|
@mbasmanova Could you help approve this PR? |
|
@caithagoras I don't have context on this change and I won't have bandwidth to review it. |
|
@rongrong will you be able to review this PR? Thank you! |
Hi Masha, this PR is part of Issue #14111 |
|
cc @rongrong for final approval |
| { | ||
| private final BenchmarkSuiteSupplier benchmarkSuiteSupplier; | ||
| private final PhaseExecutorFactory phaseExecutorFactory; | ||
| private final ConcurrentPhaseExecutor concurrentPhaseExecutor; |
There was a problem hiding this comment.
So basically BenchmarkRunner will have as many executors are there are execution strategies?
There was a problem hiding this comment.
Yes, and there will only be 2 in the foreseeable future. CONCURRENT and STREAM
Uh oh!
There was an error while loading. Please reload this page.