Merge pull request #297 from gyuho/tip

*: add 'etcdtip' as database ID
This commit is contained in:
Gyu-Ho Lee 2017-02-13 17:12:55 -08:00 committed by GitHub
commit ca2b4d7a87
3 changed files with 23 additions and 11 deletions

View File

@ -251,6 +251,8 @@ func getRGB(databaseID string, i int) color.Color {
return color.RGBA{218, 97, 229, 255} // purple return color.RGBA{218, 97, 229, 255} // purple
case "etcdv3": case "etcdv3":
return color.RGBA{24, 90, 169, 255} // blue return color.RGBA{24, 90, 169, 255} // blue
case "etcdtip":
return color.RGBA{0, 229, 255, 255} // cyan
case "zookeeper": case "zookeeper":
return color.RGBA{38, 169, 24, 255} // green return color.RGBA{38, 169, 24, 255} // green
case "consul": case "consul":
@ -258,7 +260,7 @@ func getRGB(databaseID string, i int) color.Color {
case "zetcd": case "zetcd":
return color.RGBA{251, 206, 0, 255} // yellow return color.RGBA{251, 206, 0, 255} // yellow
case "cetcd": case "cetcd":
return color.RGBA{116, 24, 169, 255} // purple return color.RGBA{205, 220, 57, 255} // lime
} }
return plotutil.Color(i) return plotutil.Color(i)
} }
@ -269,6 +271,8 @@ func getRGBII(databaseID string, i int) color.Color {
return color.RGBA{229, 212, 231, 255} // light-purple return color.RGBA{229, 212, 231, 255} // light-purple
case "etcdv3": case "etcdv3":
return color.RGBA{129, 212, 247, 255} // light-blue return color.RGBA{129, 212, 247, 255} // light-blue
case "etcdtip":
return color.RGBA{132, 255, 255, 255} // light-cyan
case "zookeeper": case "zookeeper":
return color.RGBA{129, 247, 152, 255} // light-green return color.RGBA{129, 247, 152, 255} // light-green
case "consul": case "consul":
@ -276,7 +280,7 @@ func getRGBII(databaseID string, i int) color.Color {
case "zetcd": case "zetcd":
return color.RGBA{245, 247, 166, 255} // light-yellow return color.RGBA{245, 247, 166, 255} // light-yellow
case "cetcd": case "cetcd":
return color.RGBA{247, 166, 238, 255} // light-purple return color.RGBA{238, 255, 65, 255} // light-lime
} }
return plotutil.Color(i) return plotutil.Color(i)
} }
@ -287,6 +291,8 @@ func getRGBIII(databaseID string, i int) color.Color {
return color.RGBA{165, 8, 180, 255} // deep-purple return color.RGBA{165, 8, 180, 255} // deep-purple
case "etcdv3": case "etcdv3":
return color.RGBA{37, 29, 191, 255} // deep-blue return color.RGBA{37, 29, 191, 255} // deep-blue
case "etcdtip":
return color.RGBA{0, 96, 100, 255} // deep-cyan
case "zookeeper": case "zookeeper":
return color.RGBA{7, 64, 35, 255} // deep-green return color.RGBA{7, 64, 35, 255} // deep-green
case "consul": case "consul":
@ -294,7 +300,7 @@ func getRGBIII(databaseID string, i int) color.Color {
case "zetcd": case "zetcd":
return color.RGBA{229, 255, 0, 255} // deep-yellow return color.RGBA{229, 255, 0, 255} // deep-yellow
case "cetcd": case "cetcd":
return color.RGBA{255, 0, 251, 255} // deep-purple return color.RGBA{205, 220, 57, 255} // deep-lime
} }
return plotutil.Color(i) return plotutil.Color(i)
} }

View File

@ -247,6 +247,12 @@ func ReadConfig(fpath string, analyze bool) (*Config, error) {
} }
cfg.DatabaseIDToTestGroup["etcdv3"] = v cfg.DatabaseIDToTestGroup["etcdv3"] = v
} }
if v, ok := cfg.DatabaseIDToTestGroup["etcdtip"]; ok {
if v.Etcdv3.SnapCount == 0 {
v.Etcdv3.SnapCount = defaultEtcdSnapCount
}
cfg.DatabaseIDToTestGroup["etcdtip"] = v
}
if v, ok := cfg.DatabaseIDToTestGroup["zookeeper"]; ok { if v, ok := cfg.DatabaseIDToTestGroup["zookeeper"]; ok {
if v.Zookeeper.TickTime == 0 { if v.Zookeeper.TickTime == 0 {
v.Zookeeper.TickTime = defaultZookeeperTickTime v.Zookeeper.TickTime = defaultZookeeperTickTime

View File

@ -175,7 +175,7 @@ func (cfg *Config) Stress(databaseID string) error {
switch gcfg.DatabaseID { switch gcfg.DatabaseID {
case "etcdv2": case "etcdv2":
totalKeysFunc = getTotalKeysEtcdv2 totalKeysFunc = getTotalKeysEtcdv2
case "etcdv3": case "etcdv3", "etcdtip":
totalKeysFunc = getTotalKeysEtcdv3 totalKeysFunc = getTotalKeysEtcdv3
case "zookeeper", "zetcd": case "zookeeper", "zetcd":
totalKeysFunc = getTotalKeysZk totalKeysFunc = getTotalKeysZk
@ -208,7 +208,7 @@ func (cfg *Config) Stress(databaseID string) error {
os.Exit(1) os.Exit(1)
} }
case "etcdv3": case "etcdv3", "etcdtip":
plog.Infof("write started [request: PUT | key: %q | database: %q]", key, gcfg.DatabaseID) plog.Infof("write started [request: PUT | key: %q | database: %q]", key, gcfg.DatabaseID)
var err error var err error
for i := 0; i < 7; i++ { for i := 0; i < 7; i++ {
@ -280,7 +280,7 @@ func (cfg *Config) Stress(databaseID string) error {
clients := mustCreateClientsEtcdv2(gcfg.DatabaseEndpoints, 1) clients := mustCreateClientsEtcdv2(gcfg.DatabaseEndpoints, 1)
_, err = clients[0].Set(context.Background(), key, value, nil) _, err = clients[0].Set(context.Background(), key, value, nil)
case "etcdv3": case "etcdv3", "etcdtip":
clients := mustCreateClientsEtcdv3(gcfg.DatabaseEndpoints, etcdv3ClientCfg{ clients := mustCreateClientsEtcdv3(gcfg.DatabaseEndpoints, etcdv3ClientCfg{
totalConns: 1, totalConns: 1,
totalClients: 1, totalClients: 1,
@ -319,7 +319,7 @@ func newReadHandlers(gcfg TestGroup) (rhs []ReqHandler, done func()) {
for i := range conns { for i := range conns {
rhs[i] = newGetEtcd2(conns[i]) rhs[i] = newGetEtcd2(conns[i])
} }
case "etcdv3": case "etcdv3", "etcdtip":
clients := mustCreateClientsEtcdv3(gcfg.DatabaseEndpoints, etcdv3ClientCfg{ clients := mustCreateClientsEtcdv3(gcfg.DatabaseEndpoints, etcdv3ClientCfg{
totalConns: gcfg.BenchmarkOptions.ConnectionNumber, totalConns: gcfg.BenchmarkOptions.ConnectionNumber,
totalClients: gcfg.BenchmarkOptions.ClientNumber, totalClients: gcfg.BenchmarkOptions.ClientNumber,
@ -359,7 +359,7 @@ func newWriteHandlers(gcfg TestGroup) (rhs []ReqHandler, done func()) {
for i := range conns { for i := range conns {
rhs[i] = newPutEtcd2(conns[i]) rhs[i] = newPutEtcd2(conns[i])
} }
case "etcdv3": case "etcdv3", "etcdtip":
etcdClients := mustCreateClientsEtcdv3(gcfg.DatabaseEndpoints, etcdv3ClientCfg{ etcdClients := mustCreateClientsEtcdv3(gcfg.DatabaseEndpoints, etcdv3ClientCfg{
totalConns: gcfg.BenchmarkOptions.ConnectionNumber, totalConns: gcfg.BenchmarkOptions.ConnectionNumber,
totalClients: gcfg.BenchmarkOptions.ClientNumber, totalClients: gcfg.BenchmarkOptions.ClientNumber,
@ -434,7 +434,7 @@ func newReadOneshotHandlers(gcfg TestGroup) []ReqHandler {
return newGetEtcd2(conns[0])(ctx, req) return newGetEtcd2(conns[0])(ctx, req)
} }
} }
case "etcdv3": case "etcdv3", "etcdtip":
for i := range rhs { for i := range rhs {
rhs[i] = func(ctx context.Context, req *request) error { rhs[i] = func(ctx context.Context, req *request) error {
conns := mustCreateClientsEtcdv3(gcfg.DatabaseEndpoints, etcdv3ClientCfg{ conns := mustCreateClientsEtcdv3(gcfg.DatabaseEndpoints, etcdv3ClientCfg{
@ -485,7 +485,7 @@ func generateReads(gcfg TestGroup, key string, inflightReqs chan<- request) {
// serializable read by default // serializable read by default
inflightReqs <- request{etcdv2Op: etcdv2Op{key: key}} inflightReqs <- request{etcdv2Op: etcdv2Op{key: key}}
case "etcdv3": case "etcdv3", "etcdtip":
opts := []clientv3.OpOption{clientv3.WithRange("")} opts := []clientv3.OpOption{clientv3.WithRange("")}
if gcfg.BenchmarkOptions.StaleRead { if gcfg.BenchmarkOptions.StaleRead {
opts = append(opts, clientv3.WithSerializable()) opts = append(opts, clientv3.WithSerializable())
@ -540,7 +540,7 @@ func generateWrites(gcfg TestGroup, startIdx int64, vals values, inflightReqs ch
switch gcfg.DatabaseID { switch gcfg.DatabaseID {
case "etcdv2": case "etcdv2":
inflightReqs <- request{etcdv2Op: etcdv2Op{key: k, value: vs}} inflightReqs <- request{etcdv2Op: etcdv2Op{key: k, value: vs}}
case "etcdv3": case "etcdv3", "etcdtip":
inflightReqs <- request{etcdv3Op: clientv3.OpPut(k, vs)} inflightReqs <- request{etcdv3Op: clientv3.OpPut(k, vs)}
case "zookeeper", "zetcd": case "zookeeper", "zetcd":
inflightReqs <- request{zkOp: zkOp{key: "/" + k, value: v}} inflightReqs <- request{zkOp: zkOp{key: "/" + k, value: v}}