Exemplo n.º 1
0
Arquivo: main.go Projeto: xqbumu/learn
func main() {
	switch opt {

	case "grpc":
		demogrpc.Stress(port, endpoint, keys, vals, connsN, clientsN)

	case "jsonrpc":
		demojsonrpc.Stress(port, endpoint, keys, vals)

	}
}
Exemplo n.º 2
0
func BenchmarkStress(b *testing.B) {
	b.StartTimer()
	b.ReportAllocs()

	oncebody := func() {
		switch opt {
		case "grpc":
			port := ":8000"
			endpoint := "localhost" + port
			demogrpc.Stress(port, endpoint, keys, vals, connsN, clientsN)
		case "jsonrpc":
			port := ":8001"
			endpoint := "localhost" + port
			demojsonrpc.Stress(port, endpoint, keys, vals)
		}
	}
	once.Do(oncebody)
}