Skip to content

bench/ddl_analysis: de-flake, clean up format, improve usability#61830

Merged
craig[bot] merged 3 commits intocockroachdb:masterfrom
ajwerner:ajwerner/fix-ddl_analysis-test
Mar 11, 2021
Merged

bench/ddl_analysis: de-flake, clean up format, improve usability#61830
craig[bot] merged 3 commits intocockroachdb:masterfrom
ajwerner:ajwerner/fix-ddl_analysis-test

Conversation

@ajwerner
Copy link
Copy Markdown
Contributor

See individual commits.

Fixes #57771.

This commit deflakes the expectation test by properly dealing with transaction
retries and throwing away those results.

Release note: None
@ajwerner ajwerner requested review from RichardJCai and rafiss March 11, 2021 03:01
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

This change copies the output of the invoked benchmarks to the outer
test and logs parsed results.

Release note: None
@ajwerner ajwerner force-pushed the ajwerner/fix-ddl_analysis-test branch from e5fbe81 to d24b8d3 Compare March 11, 2021 03:24
Copy link
Copy Markdown
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very exciting to have this test back!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner and @RichardJCai)


pkg/bench/ddl_analysis/ddl_analysis_bench.go, line 104 at r1 (raw file):

			}

			b.ReportMetric(float64(roundTrips)/float64(b.N), "roundtrips")

i'm not super familiar with custom metrics in benchmarks but it seems like the docs say If the metric is per-iteration, the caller should divide by b.N -- so do we need to divide here? it looks like it's outside of the loop

Copy link
Copy Markdown
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meant to lgtm, just had a question about tests

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner and @RichardJCai)

This makes it slightly easier to read and update.

Release note: None
@ajwerner ajwerner force-pushed the ajwerner/fix-ddl_analysis-test branch from d24b8d3 to 70abbfc Compare March 11, 2021 14:34
Copy link
Copy Markdown
Contributor Author

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @rafiss and @RichardJCai)


pkg/bench/ddl_analysis/ddl_analysis_bench.go, line 104 at r1 (raw file):

Previously, rafiss (Rafi Shamim) wrote…

i'm not super familiar with custom metrics in benchmarks but it seems like the docs say If the metric is per-iteration, the caller should divide by b.N -- so do we need to divide here? it looks like it's outside of the loop

Note that this variable is accumulated per iteration. The metric is per iteration. We are dividing here in order to fit the API.

The old code used to only look at the last iteration 😬

Copy link
Copy Markdown
Contributor Author

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @rafiss and @RichardJCai)

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 11, 2021

Build succeeded:

@craig craig bot merged commit a86cf54 into cockroachdb:master Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bench/ddl_analysis: unskip TestBenchmarkExpectation

3 participants