honeycombio / libhoney-rb

Ruby library for sending data to Honeycomb
Apache License 2.0
11 stars 30 forks source link

early return for sampled-out event #7

Closed josler closed 7 years ago

josler commented 7 years ago

Whilst @libhoney.should_drop(self.sample_rate) does return correctly, the code continues on to send the event anyway.

The test raises an exception when client.send_event is called - I tried getting this to work using Webmock asserting that the HTTP call was never made, but due to the asynchronous nature of sending that doesn't work very well (test finishes before it's sent).

fixes https://github.com/honeycombio/libhoney-rb/issues/6

samstokes commented 7 years ago

Thanks for catching this, and for contributing the fix!