From 90952ac3c0f6713ce74bf433970b40cee8c53f1b Mon Sep 17 00:00:00 2001 From: Kosuke Morimoto Date: Mon, 6 Jul 2020 16:44:04 +0900 Subject: [PATCH] fix format Signed-off-by: Kosuke Morimoto --- pkg/tools/cli/loadtest/service/insert.go | 6 +++--- pkg/tools/cli/loadtest/service/loader.go | 2 +- pkg/tools/cli/loadtest/service/search.go | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/tools/cli/loadtest/service/insert.go b/pkg/tools/cli/loadtest/service/insert.go index 012186e3511..fb70bd0ab68 100644 --- a/pkg/tools/cli/loadtest/service/insert.go +++ b/pkg/tools/cli/loadtest/service/insert.go @@ -66,7 +66,7 @@ func objectVectorProvider(dataset assets.Dataset) (func() interface{}, int) { func objectVectorsProvider(dataset assets.Dataset, n int) (func() interface{}, int) { provider, s := objectVectorProvider(dataset) size := s / n - if s % n != 0 { + if s%n != 0 { size = size + 1 } return func() (ret interface{}) { @@ -138,7 +138,7 @@ func (l *loader) newInsert() (f loadFunc, err error) { return f, nil } -func (l *loader) newStreamInsert() (f loadFunc, err error) { +func (l *loader) newStreamInsert() (f loadFunc, err error) { l.batchSize = 1 switch l.service { case config.Agent: @@ -156,4 +156,4 @@ func (l *loader) newStreamInsert() (f loadFunc, err error) { return nil, err } return f, nil -} \ No newline at end of file +} diff --git a/pkg/tools/cli/loadtest/service/loader.go b/pkg/tools/cli/loadtest/service/loader.go index 657c879b3b2..3dc5f78234f 100644 --- a/pkg/tools/cli/loadtest/service/loader.go +++ b/pkg/tools/cli/loadtest/service/loader.go @@ -233,7 +233,7 @@ func (l *loader) Do(ctx context.Context) <-chan error { finalize(err) return p.Signal(syscall.SIGKILL) // TODO: #403 } - log.Infof("result:%s\t%d\t%d\t%f", l.service.String(), l.concurrency, l.batchSize, vps(int(pgCnt) * l.batchSize, start, end)) + log.Infof("result:%s\t%d\t%d\t%f", l.service.String(), l.concurrency, l.batchSize, vps(int(pgCnt)*l.batchSize, start, end)) return p.Signal(syscall.SIGTERM) // TODO: #403 })) diff --git a/pkg/tools/cli/loadtest/service/search.go b/pkg/tools/cli/loadtest/service/search.go index ad3b08a8e01..53f1f9bedc0 100644 --- a/pkg/tools/cli/loadtest/service/search.go +++ b/pkg/tools/cli/loadtest/service/search.go @@ -46,8 +46,6 @@ func searchRequestProvider(dataset assets.Dataset) (func() interface{}, int, err }, size, nil } - - func (l *loader) newSearch() (loadFunc, error) { switch l.service { case config.Agent: @@ -76,4 +74,4 @@ func (l *loader) newStreamSearch() (loadFunc, error) { default: return nil, errors.Errorf("undefined service: %s", l.service.String()) } -} \ No newline at end of file +}