DataDog/dogapi-rb — pull request #55 by Kaixiang (2014-11-20 09:32:53+00:00)
Title: add open_timeout to avoid stuck

Hi:

We found sometime all our threads were blocked while doing emit_points. while the call stack looks like:
```
["/var/vcap/packages/ruby/lib/ruby/2.1.0/net/http.rb:879:in `initialize'",
"/var/vcap/packages/ruby/lib/ruby/2.1.0/net/http.rb:879:in `open'",
"/var/vcap/packages/ruby/lib/ruby/2.1.0/net/http.rb:879:in `block in connect'",
"/var/vcap/packages/ruby/lib/ruby/2.1.0/timeout.rb:76:in `timeout'",
"/var/vcap/packages/ruby/lib/ruby/2.1.0/net/http.rb:878:in `connect'",
"/var/vcap/packages/ruby/lib/ruby/2.1.0/net/http.rb:863:in `do_start'",
"/var/vcap/packages/ruby/lib/ruby/2.1.0/net/http.rb:852:in `start'",
"/var/vcap/packages/health_monitor/gem_home/ruby/2.1.0/gems/dogapi-1.6.0/lib/dogapi/common.rb:94:in `connect'",
"/var/vcap/packages/health_monitor/gem_home/ruby/2.1.0/gems/dogapi-1.6.0/lib/dogapi/common.rb:117:in `request'",
"/var/vcap/packages/health_monitor/gem_home/ruby/2.1.0/gems/dogapi-1.6.0/lib/dogapi/v1/metric.rb:40:in `submit'",
"/var/vcap/packages/health_monitor/gem_home/ruby/2.1.0/gems/dogapi-1.6.0/lib/dogapi/facade.rb:85:in `emit_points'",
...
]
```

After checking the code and it seems the open_timeout is default to nil so open timeout exception will not be triggered.
want to add a open_timeout as we do for read_timeout to avoid thread blocks.

PR as follows.

Thanks.