in cmd/bench/bench.go [27:51]
func main() {
os.Remove(remoteAddress)
os.Remove(redplexAddress)
logrus.SetLevel(logrus.DebugLevel)
benchListener, err := net.Listen("tcp", remoteAddress)
if err != nil {
logrus.WithError(err).Fatal("redplex/bench: could not listen on the requested address")
os.Exit(1)
}
redplexListener, err := net.Listen("tcp", redplexAddress)
if err != nil {
logrus.WithError(err).Fatal("redplex/bench: could not listen on the requested address")
os.Exit(1)
}
start := make(chan struct{})
go serveBenchRemote(benchListener, start)
go redplex.NewServer(redplexListener, redplex.NewPubsub(redplex.NewDirectDialer(remoteAddress, 0), time.Second)).Listen()
f, _ := os.Create("cpu.profile")
pprof.StartCPUProfile(f)
runBenchmark(start)
pprof.StopCPUProfile()
}