INNER CODE UNIT · Go
BenchmarkCreateManyClients
topfreegames/pitaya · benchmark/benchmark_test.go:52
func BenchmarkCreateManyClients(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
g := client.New(logrus.FatalLevel)
err := g.ConnectTo(fmt.Sprintf("%s:%d", "localhost", 32222))
defer g.Disconnect()
if err != nil {
b.Logf("failed to connect")
b.FailNow()
}
}
}
func BenchmarkFrontHandlerWithSessionAndRawReturnsRaw(b *testing.B) {
clients := getClients(1, 32222)