Skip to content

Redis pool size optimization #11

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions pkg/workload/core_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package workload

import (
"github.com/magiconair/properties"
"github.com/pingcap/go-ycsb/pkg/generator"
"github.com/pingcap/go-ycsb/pkg/ycsb"
"sync"
"testing"
)

func Test_core_nextKeyNum(t *testing.T) {
type fields struct {
p *properties.Properties
table string
fieldCount int64
fieldNames []string
fieldLengthGenerator ycsb.Generator
readAllFields bool
writeAllFields bool
dataIntegrity bool
keySequence ycsb.Generator
operationChooser *generator.Discrete
keyChooser ycsb.Generator
fieldChooser ycsb.Generator
transactionInsertKeySequence *generator.AcknowledgedCounter
scanLength ycsb.Generator
orderedInserts bool
recordCount int64
zeroPadding int64
insertionRetryLimit int64
insertionRetryInterval int64
valuePool sync.Pool
}
type args struct {
state *coreState
}
tests := []struct {
name string
fields fields
args args
want int64
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := &core{
p: tt.fields.p,
table: tt.fields.table,
fieldCount: tt.fields.fieldCount,
fieldNames: tt.fields.fieldNames,
fieldLengthGenerator: tt.fields.fieldLengthGenerator,
readAllFields: tt.fields.readAllFields,
writeAllFields: tt.fields.writeAllFields,
dataIntegrity: tt.fields.dataIntegrity,
keySequence: tt.fields.keySequence,
operationChooser: tt.fields.operationChooser,
keyChooser: tt.fields.keyChooser,
fieldChooser: tt.fields.fieldChooser,
transactionInsertKeySequence: tt.fields.transactionInsertKeySequence,
scanLength: tt.fields.scanLength,
orderedInserts: tt.fields.orderedInserts,
recordCount: tt.fields.recordCount,
zeroPadding: tt.fields.zeroPadding,
insertionRetryLimit: tt.fields.insertionRetryLimit,
insertionRetryInterval: tt.fields.insertionRetryInterval,
valuePool: tt.fields.valuePool,
}
if got := c.nextKeyNum(tt.args.state); got != tt.want {
t.Errorf("nextKeyNum() = %v, want %v", got, tt.want)
}
})
}
}