-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement load tester prototype #363
Conversation
Best reviewed: commit by commit
Optimal code review plan (10 warnings, 2 commits squashed)
|
Codecov Report
@@ Coverage Diff @@
## master #363 +/- ##
=========================================
+ Coverage 7.92% 8.06% +0.13%
=========================================
Files 384 381 -3
Lines 19707 19376 -331
=========================================
Hits 1562 1562
+ Misses 17924 17593 -331
Partials 221 221
Continue to review full report at Codecov.
|
Can you tell me how to execute the load test? I executed
|
the following error occurs if I run the load test % go run main.go
# github.com/vdaas/vald/pkg/tools/cli/loadtest/service/insert
../../../pkg/tools/cli/loadtest/service/insert/insert.go:21:2: imported and not used: "github.com/vdaas/vald/internal/log" |
ae7899a
to
6e0fa11
Compare
/rebase |
[REBASE] Rebase triggered by kmrmt for branch: feature/benchmark/load_test |
6e0fa11
to
b7c2b09
Compare
I execute
|
I think the error of What do you think? |
Thank you for your review! |
b7c2b09
to
bf054ab
Compare
/rebase |
[REBASE] Rebase triggered by kmrmt for branch: feature/benchmark/load_test |
[REBASE] Failed to rebase. |
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: vdaas-ci <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
Signed-off-by: Kosuke Morimoto <[email protected]>
13c0989
to
08389e2
Compare
Signed-off-by: hlts2 <[email protected]>
Signed-off-by: hlts2 <[email protected]>
Signed-off-by: hlts2 <[email protected]>
Signed-off-by: hlts2 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: hlts2 <[email protected]>
Signed-off-by: hlts2 <[email protected]>
} | ||
|
||
var ( | ||
data = map[string]func() (Dataset, error){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
data
is a global variable (gochecknoglobals)
// CreateRandomIDsWithLength generates random string IDs that have specified length. | ||
func CreateRandomIDsWithLength(n, l int) (ids []string) { | ||
ids = make([]string, 0, n) | ||
for i := 0; i < n; i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
for statements should only be cuddled with assignments used in the iteration (wsl)
ObjectType() string | ||
} | ||
|
||
type dataset struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
struct of size 296 bytes could be of size 288 bytes (maligned)
} | ||
|
||
func Test_dataset_Train(t *testing.T) { | ||
type fields struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
struct of size 296 bytes could be of size 288 bytes (maligned)
} | ||
|
||
func Test_dataset_TrainAsFloat64(t *testing.T) { | ||
type fields struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
struct of size 296 bytes could be of size 288 bytes (maligned)
trainOnce: test.fields.trainOnce, | ||
query: test.fields.query, | ||
queryAsFloat64: test.fields.queryAsFloat64, | ||
queryOnce: test.fields.queryOnce, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
copylocks: literal copies lock value from test.fields.queryOnce: sync.Once contains sync.Mutex (govet)
queryOnce: test.fields.queryOnce, | ||
distances: test.fields.distances, | ||
distancesAsFloat64: test.fields.distancesAsFloat64, | ||
distancesOnce: test.fields.distancesOnce, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
copylocks: literal copies lock value from test.fields.distancesOnce: sync.Once contains sync.Mutex (govet)
|
||
func identity(dim int) func() (Dataset, error) { | ||
return func() (Dataset, error) { | ||
ids := CreateSerialIDs(dim * 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
mnd: Magic number: 1000, in detected (gomnd)
} | ||
|
||
// Do operates load test. | ||
func (l *loader) Do(ctx context.Context) <-chan error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
Function 'Do' is too long (78 > 60) (funlen)
var pgCnt int32 = 0 | ||
var start time.Time | ||
progress := func() { | ||
log.Infof("progress %d items, %f[qps]", pgCnt, float64(pgCnt)/time.Now().Sub(start).Seconds()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
S1012: should use time.Since
instead of time.Now().Sub
(gosimple)
Description:
I added load test code for vald with internal/client and pkg package structure
Related Issue:
#346
How Has This Been Tested?:
This PR is Work in Progress.
Environment:
Types of changes:
Changes to Core Features:
Checklist: