-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
roachprod-microbench: add clean command #126810
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few minor comments.
Side note: You can add the description into the commit |
3ddc89b
to
12b8c2d
Compare
7faacb2
to
bd19424
Compare
TFTR !! bors r=@herkolategan |
bors cancel |
Canceled. |
bd19424
to
9a58f51
Compare
Epic: none Release note: None Previously cleaning benchmark output was only internally exposed in roachprod-microbench, but we now need it as part of a CI job, hence a new utility command "clean" has been added to roachprod-microbench See: cockroachdb#106661
9a58f51
to
1399985
Compare
TFTR !! bors r=@herkolategan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments!
For those of us with less context, it would have been helpful for the commit to be more substantial in the explanation provided (and also for future understandability).
In addition, it's not entirely clear to me how this is "part of fixing #106661" -- that issue refers to roachperf/macro benchmarks, and this is a change related to our microbenchmark infrastructure?
|
||
return command | ||
} | ||
|
||
func makeCleanCommand() *cobra.Command { | ||
config := defaultCleanConfig() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: this function is unnecessary; variables in Go are always initialized to their zero value1. This is equivalent to var config cleanConfig
.
Footnotes
func makeCleanCommand() *cobra.Command { | ||
config := defaultCleanConfig() | ||
runCmdFunc := func(cmd *cobra.Command, commandLine []string) error { | ||
args, _ := splitArgsAtDash(cmd, commandLine) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need splitArgsAtDash
. This command doesn't seem to require or support any other args other than the two expected file paths.
|
||
func (c *clean) writeCleanOutputToFile(cleanedBenchmarkOutputLog benchmarkExtractionResult) error { | ||
|
||
if err := os.MkdirAll(filepath.Dir(c.outputFilePath), os.ModePerm); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I find this behaviour quite unusual for a command line utility: if I pass foo/bar/baz/path.txt
to a command, I wouldn't expect it to create the entire directory tree to write to path.txt
. It's generally better to have the caller be responsible for passing a valid path to begin with.
It makes handling these paths more explicit and also makes errors more evident, as writing to the path would fail if the path passed is invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@renatolabs Good point! Since this is meant to be added as a CI step, I was thinking it is fine we can create the directory in the code itself.
command := &cobra.Command{ | ||
Use: "clean <inputFilePath> <outputFilePath>", | ||
Short: "remove noisy logs from the benchmark output and dump it to a file", | ||
Long: `remove noisy logs from the benchmark output and dump it to a file`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand things right, this is kind of summarizing benchmark results and writing the summary to a file. Using remove
here sounds like it's performing a destructive operation, which is not the case.
It's also unclear what "it" refers to in this sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, will update the documentation.
Build succeeded: |
This PR doesn't fully fix the issue but adds a utility command in
Noted. Thanks for pointing out ! |
There were post-review comments in cockroachdb#126810. This change aims to address those. Epic: none Release note: None
Epic: none Release note: None As part of fixing cockroachdb#106661, we need to run microbenchmarks in a CI job and compare the microbenchmarks with that of the latest master branch commit. For this purpose we want to re-use `roachprod-microbench` compare command. However, as of current implementation of the compare command, it doesn't do threshold comparison and this PR aims to add that capability using a flag. It is a follow up change to cockroachdb#126810 which exposed `roachprod-microbench` capability of cleaning the benchmark output.
126884: roachprod-microbench: address review comments in clean command r=renatolabs a=sambhav-jain-16 There were post-review comments in #126810. This change aims to address those. Epic: none Release note: None Co-authored-by: Sambhav Jain <[email protected]>
Epic: none Release note: None As part of fixing cockroachdb#106661, we need to run microbenchmarks in a CI job and compare the microbenchmarks with that of the latest master branch commit. For this purpose we want to re-use `roachprod-microbench` compare command. However, as of current implementation of the compare command, it doesn't do threshold comparison and this PR aims to add that capability using a flag. It is a follow up change to cockroachdb#126810 which exposed `roachprod-microbench` capability of cleaning the benchmark output.
Epic: none Release note: None As part of fixing cockroachdb#106661, we need to run microbenchmarks in a CI job and compare the microbenchmarks with that of the latest master branch commit. For this purpose we want to re-use `roachprod-microbench` compare command. However, as of current implementation of the compare command, it doesn't do threshold comparison and this PR aims to add that capability using a flag. This change also adds a flag `--publish-sheets` to optionally allow publishing google sheets or not. It is a follow up change to cockroachdb#126810 which exposed `roachprod-microbench` capability of cleaning the benchmark output.
Epic: none Release note: None As part of fixing cockroachdb#106661, we need to run microbenchmarks in a CI job and compare the microbenchmarks with that of the latest master branch commit. For this purpose we want to re-use `roachprod-microbench` compare command. However, as of current implementation of the compare command, it doesn't do threshold comparison and this PR aims to add that capability using a flag. This change also adds a flag `--publish-sheets` to optionally allow publishing google sheets. It is a follow up change to cockroachdb#126810 which exposed `roachprod-microbench` capability of cleaning the benchmark output.
126885: roachprod-microbench: add threshold flag to compare command r=herkolategan a=sambhav-jain-16 Epic: none Release note: None As part of fixing #106661, we need to run microbenchmarks in a CI job and compare the microbenchmarks with that of the latest master branch commit. For this purpose we want to re-use `roachprod-microbench` compare command. However, as of current implementation of the compare command, it doesn't do threshold comparison and this PR aims to add that capability using a flag. This change also adds a flag `--publish-sheets` to optionally allow publishing google sheets or not. It is a follow up change to #126810 which exposed `roachprod-microbench` capability of cleaning the benchmark output. Co-authored-by: Sambhav Jain <[email protected]>
Epic: none
Release note: None
This change adds a new utility command to
roachprod-microbench
as part of fixing #106661.