acquia / statsgod

A Statsd implementation written in GO lang
Apache License 2.0
119 stars 8 forks source link

Improving the tests around the connection pool and relays. #51

Closed kevinhankens closed 9 years ago

kevinhankens commented 9 years ago

This adds tests to verify that we can handle multiple metrics separated by newline characters in TCP and Unix socket connections. It also adds a NilConn struct which is a net.Conn interface implementation. The purpose of this is because when the connection pool times out, it currently returns nil. This is poor because it tries to coerce nil into a net.Conn which causes a nil pointer access error. The new NilConn allows us to return the proper type and panic if client code tries to use it. This is much more graceful and allows us to properly test access to a broken connection.