mirror of https://github.com/etcd-io/dbtester.git
control, bench-configuration: update client variables
This commit is contained in:
parent
048585714a
commit
32b166c4dc
|
|
@ -35,13 +35,8 @@ step2:
|
|||
stale_read: true
|
||||
connections: 1
|
||||
clients: 1
|
||||
connections_clients: # if specified, connections, clients are overwritten
|
||||
- 1
|
||||
- 10
|
||||
- 50
|
||||
- 100
|
||||
- 500
|
||||
- 1000
|
||||
# if specified, connections, clients are overwritten
|
||||
connections_clients: [1, 3, 5, 10, 50, 100, 500, 700, 1000]
|
||||
key_size: 256
|
||||
value_size: 1024
|
||||
total_requests: 1000000
|
||||
|
|
|
|||
|
|
@ -35,13 +35,8 @@ step2:
|
|||
stale_read: true
|
||||
connections: 1
|
||||
clients: 1
|
||||
connections_clients: # if specified, connections, clients are overwritten
|
||||
- 1
|
||||
- 10
|
||||
- 50
|
||||
- 100
|
||||
- 500
|
||||
- 1000
|
||||
# if specified, connections, clients are overwritten
|
||||
connections_clients: [1, 3, 5, 10, 50, 100, 500, 700, 1000]
|
||||
key_size: 256
|
||||
value_size: 1024
|
||||
total_requests: 1000000
|
||||
|
|
|
|||
|
|
@ -35,13 +35,8 @@ step2:
|
|||
stale_read: true
|
||||
connections: 1
|
||||
clients: 1
|
||||
connections_clients: # if specified, connections, clients are overwritten
|
||||
- 1
|
||||
- 10
|
||||
- 50
|
||||
- 100
|
||||
- 500
|
||||
- 1000
|
||||
# if specified, connections, clients are overwritten
|
||||
connections_clients: [1, 3, 5, 10, 50, 100, 500, 700, 1000]
|
||||
key_size: 256
|
||||
value_size: 1024
|
||||
total_requests: 1000000
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ func TestReadConfig(t *testing.T) {
|
|||
if c.Step2.Connections != 1 {
|
||||
t.Fatalf("unexpected %d", c.Step2.Connections)
|
||||
}
|
||||
if !reflect.DeepEqual(c.Step2.ConnectionsClients, []int{1, 10, 50, 100, 500, 1000}) {
|
||||
if !reflect.DeepEqual(c.Step2.ConnectionsClients, []int{1, 3, 5, 10, 50, 100, 500, 700, 1000}) {
|
||||
t.Fatalf("unexpected %d", c.Step2.ConnectionsClients)
|
||||
}
|
||||
if c.Step2.KeySize != 256 {
|
||||
|
|
|
|||
|
|
@ -34,13 +34,8 @@ step2:
|
|||
stale_read: true
|
||||
connections: 1
|
||||
clients: 1
|
||||
connections_clients: # if specified, connections, clients are overwritten
|
||||
- 1
|
||||
- 10
|
||||
- 50
|
||||
- 100
|
||||
- 500
|
||||
- 1000
|
||||
# if specified, connections, clients are overwritten
|
||||
connections_clients: [1, 3, 5, 10, 50, 100, 500, 700, 1000]
|
||||
key_size: 256
|
||||
value_size: 1024
|
||||
total_requests: 100000
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ package control
|
|||
|
||||
func assignRequest(ranges []int, total int) (rs []int) {
|
||||
reqEach := int(float64(total) / float64(len(ranges)))
|
||||
// truncate 10000th digits
|
||||
if reqEach > 10000 {
|
||||
reqEach = (reqEach / 10000) * 10000
|
||||
}
|
||||
// truncate 1000th digits
|
||||
if reqEach > 1000 {
|
||||
reqEach = (reqEach / 1000) * 1000
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ import (
|
|||
)
|
||||
|
||||
func Test_assignRequest(t *testing.T) {
|
||||
ranges := []int{1, 10, 50, 100, 500, 1000}
|
||||
total := 100000
|
||||
ranges := []int{1, 3, 5, 10, 50, 100, 500, 700, 1000}
|
||||
total := 1000000
|
||||
rs := assignRequest(ranges, total)
|
||||
expected := []int{16000, 16000, 16000, 16000, 16000, 20000}
|
||||
expected := []int{110000, 110000, 110000, 110000, 110000, 110000, 110000, 110000, 120000}
|
||||
if !reflect.DeepEqual(rs, expected) {
|
||||
t.Fatalf("expected %+v, got %+v", expected, rs)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue