From 32b166c4dc7794d40c3858b7a2e9575be936873f Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Mon, 23 Jan 2017 16:38:44 -0800 Subject: [PATCH] control, bench-configuration: update client variables --- .../03-write-1M-keys-client-variable/01-etcd-v3.1.yaml | 9 ++------- .../02-zookeeper-r3.4.9.yaml | 9 ++------- .../03-consul-v0.7.2.yaml | 9 ++------- control/config_test.go | 2 +- control/config_test.yaml | 9 ++------- control/step2_stress_util.go | 4 ++++ control/step2_stress_util_test.go | 6 +++--- 7 files changed, 16 insertions(+), 32 deletions(-) diff --git a/bench-configuration/03-write-1M-keys-client-variable/01-etcd-v3.1.yaml b/bench-configuration/03-write-1M-keys-client-variable/01-etcd-v3.1.yaml index 0b2fc7b4..f67e6882 100644 --- a/bench-configuration/03-write-1M-keys-client-variable/01-etcd-v3.1.yaml +++ b/bench-configuration/03-write-1M-keys-client-variable/01-etcd-v3.1.yaml @@ -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 diff --git a/bench-configuration/03-write-1M-keys-client-variable/02-zookeeper-r3.4.9.yaml b/bench-configuration/03-write-1M-keys-client-variable/02-zookeeper-r3.4.9.yaml index d25f36af..4d0e2b99 100644 --- a/bench-configuration/03-write-1M-keys-client-variable/02-zookeeper-r3.4.9.yaml +++ b/bench-configuration/03-write-1M-keys-client-variable/02-zookeeper-r3.4.9.yaml @@ -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 diff --git a/bench-configuration/03-write-1M-keys-client-variable/03-consul-v0.7.2.yaml b/bench-configuration/03-write-1M-keys-client-variable/03-consul-v0.7.2.yaml index 4169ae77..fa70a949 100644 --- a/bench-configuration/03-write-1M-keys-client-variable/03-consul-v0.7.2.yaml +++ b/bench-configuration/03-write-1M-keys-client-variable/03-consul-v0.7.2.yaml @@ -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 diff --git a/control/config_test.go b/control/config_test.go index 58da513e..f73404a9 100644 --- a/control/config_test.go +++ b/control/config_test.go @@ -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 { diff --git a/control/config_test.yaml b/control/config_test.yaml index d16c26ce..a42f2b0e 100644 --- a/control/config_test.yaml +++ b/control/config_test.yaml @@ -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 diff --git a/control/step2_stress_util.go b/control/step2_stress_util.go index cda1d335..6fb2142a 100644 --- a/control/step2_stress_util.go +++ b/control/step2_stress_util.go @@ -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 diff --git a/control/step2_stress_util_test.go b/control/step2_stress_util_test.go index 457ed366..d510a68b 100644 --- a/control/step2_stress_util_test.go +++ b/control/step2_stress_util_test.go @@ -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) }