mirror of
https://github.com/kopia/kopia.git
synced 2026-05-18 19:54:37 -04:00
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:
@@ -21,6 +21,7 @@
|
||||
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 @@ type benchResult struct {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user