From c13ec0a16d118faee05af3fccd0af75532ba0979 Mon Sep 17 00:00:00 2001 From: Thomas Jungblut Date: Mon, 5 Aug 2024 11:26:48 +0200 Subject: [PATCH] cmd/bbolt: write bench results to stdout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit backport of #767 to fix the missing output on nightly benchmarks Co-authored-by: Iván Valdés Castillo Signed-off-by: Thomas Jungblut --- cmd/bbolt/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/bbolt/main.go b/cmd/bbolt/main.go index ed0d89e28..12ce35a53 100644 --- a/cmd/bbolt/main.go +++ b/cmd/bbolt/main.go @@ -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, "")