Connections pool for output_tcp

This commit is contained in:
Leonid Bugaev
2013-11-02 21:45:49 +01:00
parent 9bba1296bd
commit fd9f6cd056
6 changed files with 73 additions and 47 deletions
+3 -2
View File
@@ -69,9 +69,10 @@ func BenchmarkTCPInput(b *testing.B) {
var connections []net.Conn
// Creating simple pool of workers, same as output_tcp have
dataChan := make(chan []byte, 1000)
for i := 0; i < 100; i++ {
for i := 0; i < 10; i++ {
conn, _ := net.DialTCP("tcp", nil, tcpAddr)
connections = append(connections, conn)
@@ -93,8 +94,8 @@ func BenchmarkTCPInput(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
dataChan <- msg
wg.Add(1)
dataChan <- msg
}
wg.Wait()