INNER CODE UNIT · Go

TestMain

topfreegames/pitaya · benchmark/benchmark_test.go:47

func TestMain(m *testing.M) {
	exit := m.Run()
	os.Exit(exit)
}

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()
		}
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…