control, bench-configuration: update client variables

This commit is contained in:
Gyu-Ho Lee 2017-01-23 16:38:44 -08:00
parent 048585714a
commit 32b166c4dc
No known key found for this signature in database
GPG Key ID: 1DDD39C7EB70C24C
7 changed files with 16 additions and 32 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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

View File

@ -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)
}