From 47b644993446527cd50de4b4312626428f695062 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Wed, 17 Aug 2016 09:45:43 -0700 Subject: [PATCH] functional-tester: put large keys For testing writes that must span multiple pages. --- tools/functional-tester/etcd-tester/cluster.go | 2 ++ tools/functional-tester/etcd-tester/main.go | 4 +++- tools/functional-tester/etcd-tester/stresser.go | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/functional-tester/etcd-tester/cluster.go b/tools/functional-tester/etcd-tester/cluster.go index 9329a6e72..52d11b10b 100644 --- a/tools/functional-tester/etcd-tester/cluster.go +++ b/tools/functional-tester/etcd-tester/cluster.go @@ -39,6 +39,7 @@ type cluster struct { datadir string stressQPS int + stressKeyLargeSize int stressKeySize int stressKeySuffixRange int @@ -111,6 +112,7 @@ func (c *cluster) bootstrap(agentEndpoints []string) error { } else { c.Stressers[i] = &stresser{ Endpoint: m.grpcAddr(), + keyLargeSize: c.stressKeyLargeSize, keySize: c.stressKeySize, keySuffixRange: c.stressKeySuffixRange, N: stressN, diff --git a/tools/functional-tester/etcd-tester/main.go b/tools/functional-tester/etcd-tester/main.go index 627a7bfca..f3a9117c1 100644 --- a/tools/functional-tester/etcd-tester/main.go +++ b/tools/functional-tester/etcd-tester/main.go @@ -29,7 +29,8 @@ var plog = capnslog.NewPackageLogger("github.com/coreos/etcd", "etcd-tester") func main() { endpointStr := flag.String("agent-endpoints", "localhost:9027", "HTTP RPC endpoints of agents. Do not specify the schema.") datadir := flag.String("data-dir", "agent.etcd", "etcd data directory location on agent machine.") - stressKeySize := flag.Uint("stress-key-size", 100, "the size of each key written into etcd.") + stressKeyLargeSize := flag.Uint("stress-key-large-size", 32*1024+1, "the size of each large key written into etcd.") + stressKeySize := flag.Uint("stress-key-size", 100, "the size of each small key written into etcd.") stressKeySuffixRange := flag.Uint("stress-key-count", 250000, "the count of key range written into etcd.") limit := flag.Int("limit", -1, "the limit of rounds to run failure set (-1 to run without limits).") stressQPS := flag.Int("stress-qps", 10000, "maximum number of stresser requests per second.") @@ -42,6 +43,7 @@ func main() { v2Only: *isV2Only, datadir: *datadir, stressQPS: *stressQPS, + stressKeyLargeSize: int(*stressKeyLargeSize), stressKeySize: int(*stressKeySize), stressKeySuffixRange: int(*stressKeySuffixRange), } diff --git a/tools/functional-tester/etcd-tester/stresser.go b/tools/functional-tester/etcd-tester/stresser.go index a4c9cc6c6..698352689 100644 --- a/tools/functional-tester/etcd-tester/stresser.go +++ b/tools/functional-tester/etcd-tester/stresser.go @@ -135,6 +135,7 @@ type Stresser interface { type stresser struct { Endpoint string + keyLargeSize int keySize int keySuffixRange int @@ -179,6 +180,10 @@ func (s *stresser) Stress() error { var stressEntries = []stressEntry{ {weight: 0.7, f: newStressPut(kvc, s.keySuffixRange, s.keySize)}, + { + weight: 0.7 * float32(s.keySize) / float32(s.keyLargeSize), + f: newStressPut(kvc, s.keySuffixRange, s.keyLargeSize), + }, {weight: 0.07, f: newStressRange(kvc, s.keySuffixRange)}, {weight: 0.07, f: newStressRangeInterval(kvc, s.keySuffixRange)}, {weight: 0.07, f: newStressDelete(kvc, s.keySuffixRange)},