From 363c7b6ef6f16f5b6e7c4d8f81fc94b8e908cfe1 Mon Sep 17 00:00:00 2001 From: Raphanus Lo Date: Wed, 13 Jul 2022 11:44:04 +0800 Subject: [PATCH] optimizer: correct progress bar counter & ETA calculation --- pkg/optimizer/grid.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/optimizer/grid.go b/pkg/optimizer/grid.go index 0b76ca886..f0b2c2601 100644 --- a/pkg/optimizer/grid.go +++ b/pkg/optimizer/grid.go @@ -236,6 +236,8 @@ func (o *GridOptimizer) Run(executor Executor, configJson []byte) (map[string][] close(taskC) // this will shut down the executor for result := range resultsC { + bar.Increment() + if result.Report == nil { log.Errorf("no summaryReport found for params: %+v", result.Params) continue @@ -244,7 +246,6 @@ func (o *GridOptimizer) Run(executor Executor, configJson []byte) (map[string][] for metricKey, metricFunc := range valueFunctions { var metricValue = metricFunc(result.Report) bar.Set("log", fmt.Sprintf("params: %+v => %s %+v", result.Params, metricKey, metricValue)) - bar.Increment() metrics[metricKey] = append(metrics[metricKey], Metric{ Params: result.Params,