Skip to content

Commit

Permalink
stop benchmark if error is occurred
Browse files Browse the repository at this point in the history
Signed-off-by: Kosuke Morimoto <[email protected]>
  • Loading branch information
kmrmt authored and actions-user committed Sep 24, 2020
1 parent fd16f33 commit 1d9d0ba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions hack/benchmark/core/benchmark/strategy/bulk_insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewBulkInsert(opts ...StrategyOption) benchmark.Strategy {
for i := 0; i < size; i++ {
arr, err := dataset.Train(i)
if err != nil {
break
b.Fatal(err)
}
v = append(v, arr.([]float32))
}
Expand All @@ -72,7 +72,7 @@ func NewBulkInsert(opts ...StrategyOption) benchmark.Strategy {
for i := 0; i < size; i++ {
arr, err := dataset.Train(i)
if err != nil {
break
b.Fatal(err)
}
v = append(v, float32To64(arr.([]float32)))
}
Expand Down
4 changes: 2 additions & 2 deletions hack/benchmark/core/benchmark/strategy/bulk_insert_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewBulkInsertCommit(poolSize uint32, opts ...StrategyOption) benchmark.Stra
for i := 0; i < size; i++ {
arr, err := dataset.Train(i)
if err != nil {
break
b.Fatal(err)
}
v = append(v, arr.([]float32))
}
Expand All @@ -68,7 +68,7 @@ func NewBulkInsertCommit(poolSize uint32, opts ...StrategyOption) benchmark.Stra
for i := 0; i < size; i++ {
arr, err := dataset.Train(i)
if err != nil {
break
b.Fatal(err)
}
v = append(v, float32To64(arr.([]float32)))
}
Expand Down
6 changes: 2 additions & 4 deletions hack/benchmark/internal/e2e/strategy/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ func (isrt *insert) run(ctx context.Context, b *testing.B, c client.Client, data
for i := 0; i < bb.N; i++ {
v, err := dataset.Train(cnt % dataset.TrainSize())
if err != nil {
cnt = 0
break
b.Fatal(err)
}
isrt.do(ctx, bb, c, fmt.Sprint(cnt), v.([]float32))
cnt++
Expand All @@ -80,8 +79,7 @@ func (isrt *insert) runParallel(ctx context.Context, b *testing.B, c client.Clie
n := int(atomic.AddInt64(&cnt, 1)) - 1
v, err := dataset.Train(n % dataset.TrainSize())
if err != nil {
cnt = 0
break
b.Fatal(err)
}

isrt.do(ctx, bb, c, fmt.Sprint(cnt), v.([]float32))
Expand Down

0 comments on commit 1d9d0ba

Please sign in to comment.