minor improvements

Co-Authored-By: Ice3man <22318055+Ice3man543@users.noreply.github.com>
This commit is contained in:
sandeep 2021-07-08 18:50:03 +05:30
parent 1b8f4b3f25
commit 4988ef76b5
2 changed files with 5 additions and 1 deletions

View File

@ -193,6 +193,10 @@ func New(options *types.Options) (*Runner, error) {
if options.JSON {
options.StatsJSON = true
}
if options.StatsJSON {
options.EnableProgressBar = true
}
// Creates the progress tracking object
var progressErr error
runner.progress, progressErr = progress.NewStatsTicker(options.StatsInterval, options.EnableProgressBar, options.StatsJSON, options.Metrics, options.MetricsPort)

View File

@ -181,7 +181,7 @@ func printCallback(stats clistats.StatisticsClient) {
func printCallbackJSON(stats clistats.StatisticsClient) {
builder := &strings.Builder{}
_ = json.NewEncoder(builder).Encode(metricsMap(stats))
gologger.Print().Msg(builder.String())
fmt.Printf("%s", builder.String())
}
func metricsMap(stats clistats.StatisticsClient) map[string]interface{} {