Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions cli/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,19 @@ func runBench(ctx *cli.Context, b bench.Benchmark) error {
monitor.InfoLn(fmt.Sprintf("\nBenchmark data written to %q\n\n", fileName+".json.zst"))
}()
}
rep := final.Report(aggregate.ReportOptions{
Details: ctx.Bool("analyze.v"),
Color: !globalNoColor,
OnlyOps: getAnalyzeOPS(ctx),
})
var rep *bytes.Buffer
if globalJSON {
rep = &bytes.Buffer{}
enc := json.NewEncoder(rep)
enc.SetIndent("", " ")
_ = enc.Encode(final)
} else {
rep = final.Report(aggregate.ReportOptions{
Details: ctx.Bool("analyze.v"),
Color: !globalNoColor,
OnlyOps: getAnalyzeOPS(ctx),
})
}

monitor.UpdateAggregate(final, fileName)
ui.Update(tea.Quit())
Expand Down
8 changes: 6 additions & 2 deletions cli/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ func (u *ui) View() string {
func (u *ui) SetSubText(caption string) {
if u.quitPls.Load() {
u.Wait()
console.Printf("\r%-80s", caption)
if !globalQuiet && !globalJSON {
console.Printf("\r%-80s", caption)
}
return
}
u.phaseTxt.Store(&caption)
Expand All @@ -266,7 +268,9 @@ func (u *ui) SetSubText(caption string) {
func (u *ui) SetPhase(caption string) {
if u.quitPls.Load() {
u.Wait()
console.Println("\n" + caption)
if !globalQuiet && !globalJSON {
console.Println("\n" + caption)
}
return
}
u.phase.Store(&caption)
Expand Down
Loading