Option to print out the commands for benchmark (#779)

* Option to print out the commands for using crypto, splitter and compression

Co-authored-by: Janne Johansson <janne.johansson@safespring.com>
Co-authored-by: Jarek Kowalski <jaak@jkowalski.net>
This commit is contained in:
authored and GitHub committed 2021-01-23 20:04:09 -08:00
1 parent 6a63c207a4
commit 45912e272e
3 files changed
+39 -7

No files matched your search

+8 -1
View File
@@ -21,6 +21,7 @@ var (
benchmarkCompressionDataFile = benchmarkCompressionCommand.Flag("data-file", "Use data from the given file instead of empty").ExistingFile()
benchmarkCompressionBySize = benchmarkCompressionCommand.Flag("by-size", "Sort results by size").Bool()
benchmarkCompressionVerifyStable = benchmarkCompressionCommand.Flag("verify-stable", "Verify that compression is stable").Bool()
benchmarkCompressionOptionPrint = benchmarkCompressionCommand.Flag("print-options", "Print out options usable for repository creation").Bool()
)
func runBenchmarkCompressionAction(ctx context.Context) error {
@@ -98,7 +99,13 @@ func runBenchmarkCompressionAction(ctx context.Context) error {
printStdout("-----------------------------------------------------------------\n")
for ndx, r := range results {
printStdout("%3d. %-30v %-15v %v / second\n", ndx, r.compression, r.compressedSize, units.BytesStringBase2(int64(r.throughput)))
printStdout("%3d. %-30v %-15v %v / second", ndx, r.compression, r.compressedSize, units.BytesStringBase2(int64(r.throughput)))
if *benchmarkCompressionOptionPrint {
printStdout(", --compression=%s", r.compression)
}
printStdout("\n")
}
return nil