connection.go | 5 +++++ diff --git a/connection.go b/connection.go index e1ae70b6d60ac8e72e4207db4b8df497bc0dd730..1d70c7a7998de34e146d455adb86cea60ac08b55 100644 --- a/connection.go +++ b/connection.go @@ -431,6 +431,9 @@ }) c.Interested = interested } +var connectionWriterFlush = expvar.NewInt("connectionWriterFlush") +var connectionWriterWrite = expvar.NewInt("connectionWriterWrite") + // Writes buffers to the socket from the write channel. func (conn *connection) writer() { // Reduce write syscalls. @@ -450,6 +453,7 @@ case b, ok := <-conn.writeCh: if !ok { return } + connectionWriterWrite.Add(1) _, err := buf.Write(b) if err != nil { conn.Close() @@ -458,6 +462,7 @@ } case <-conn.closing: return case <-notEmpty: + connectionWriterFlush.Add(1) err := buf.Flush() if err != nil { return