INNER CODE UNIT · Go
BenchmarkBackHandlerWithSessionOnlyReturnsPtrParallel
topfreegames/pitaya · benchmark/benchmark_test.go:174
func BenchmarkBackHandlerWithSessionOnlyReturnsPtrParallel(b *testing.B) {
clients := getClients(1, 32222)
b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
_, err := clients[0].SendRequest("game.testsvc.testrequestonlysessionreturnsptr", []byte{})
if err != nil {
b.Logf("failed to send request to server")
b.FailNow()
}
<-clients[0].IncomingMsgChan
}
})
}
func BenchmarkBackHandlerWithSessionOnlyReturnsPtrParallelMultipleClients(b *testing.B) {
numClients := 100