Skip to content

Commit

Permalink
cmd/bbolt: write bench results to stdout
Browse files Browse the repository at this point in the history
backport of #767 to fix the missing output on nightly benchmarks

Co-authored-by: Iván Valdés Castillo <[email protected]>
Signed-off-by: Thomas Jungblut <[email protected]>
  • Loading branch information
tjungblu and ivanvc committed Aug 5, 2024
1 parent 14c8aaf commit c13ec0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/bbolt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1123,15 +1123,15 @@ func (cmd *benchCommand) Run(args ...string) error {
gobenchResult := testing.BenchmarkResult{}
gobenchResult.T = results.WriteDuration
gobenchResult.N = results.WriteOps
fmt.Fprintf(os.Stderr, "%-*s\t%s\n", maxLen, benchWriteName, gobenchResult.String())
fmt.Fprintf(os.Stdout, "%-*s\t%s\n", maxLen, benchWriteName, gobenchResult.String())

gobenchResult = testing.BenchmarkResult{}
gobenchResult.T = results.ReadDuration
gobenchResult.N = results.ReadOps
fmt.Fprintf(os.Stderr, "%-*s\t%s\n", maxLen, benchReadName, gobenchResult.String())
fmt.Fprintf(os.Stdout, "%-*s\t%s\n", maxLen, benchReadName, gobenchResult.String())
} else {
fmt.Fprintf(os.Stderr, "# Write\t%v\t(%v/op)\t(%v op/sec)\n", results.WriteDuration, results.WriteOpDuration(), results.WriteOpsPerSecond())
fmt.Fprintf(os.Stderr, "# Read\t%v\t(%v/op)\t(%v op/sec)\n", results.ReadDuration, results.ReadOpDuration(), results.ReadOpsPerSecond())
fmt.Fprintf(os.Stdout, "# Write\t%v\t(%v/op)\t(%v op/sec)\n", results.WriteDuration, results.WriteOpDuration(), results.WriteOpsPerSecond())
fmt.Fprintf(os.Stdout, "# Read\t%v\t(%v/op)\t(%v op/sec)\n", results.ReadDuration, results.ReadOpDuration(), results.ReadOpsPerSecond())
}
fmt.Fprintln(cmd.Stderr, "")

Expand Down

0 comments on commit c13ec0a

Please sign in to comment.