Beispiel #1
0
func main() {
	switch opt {

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

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

	}
}
Beispiel #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)
}