Skip to content

Commit

Permalink
fix: fix table printig
Browse files Browse the repository at this point in the history
  • Loading branch information
zezhehh committed Oct 11, 2023
1 parent 2bd2233 commit 54f68cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion output.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ func (o *ConsoleOutput) OnEvent(data map[string]interface{}) {
currentTime := time.Now()
o.logger.Println(fmt.Sprintf("Current time: %s, Users: %d, Total RPS: %d, Total Fail Ratio: %.1f%%",
currentTime.Format("2006/01/02 15:04:05"), output.UserCount, output.TotalRPS, output.TotalFailRatio*100))
table := tablewriter.NewWriter(o.logger.Writer())
noPrefixLogger := log.New(o.logger.Writer(), "", 0)
table := tablewriter.NewWriter(noPrefixLogger.Writer())
table.SetHeader([]string{"Type", "Name", "# requests", "# fails", "Median", "Average", "Min", "Max", "Content Size", "# reqs/sec", "# fails/sec"})

for _, stat := range output.Stats {
Expand Down

0 comments on commit 54f68cf

Please sign in to comment.