INNER CODE UNIT · Go
BenchmarkFrontHandlerWithSessionAndPtrReturnsPtr
topfreegames/pitaya · benchmark/benchmark_test.go:81
func BenchmarkFrontHandlerWithSessionAndPtrReturnsPtr(b *testing.B) {
clients := getClients(1, 32222)
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, err := clients[0].SendRequest("connector.testsvc.testrequestreturnsptr", []byte(`{"msg":"bench single"}`))
if err != nil {
b.Logf("failed to send request to server")
b.FailNow()
}
<-clients[0].IncomingMsgChan
}
}
func BenchmarkFrontHandlerWithSessionAndPtrReturnsPtrManyClientsParallel(b *testing.B) {
numClients := 1000
clients := getClients(numClients, 32222)