librato / librato-metrics

Ruby wrapper to make it easy to interact with Librato's API.
https://librato.com
Other
108 stars 52 forks source link

Fake Metrics Client #113

Open badosu opened 9 years ago

badosu commented 9 years ago

Is there already or the possibility of a fake metrics client?

I want to be able to use librato on development the same way I use it in production without having the hassle of checking the environment condition on each request.

If there's not, how are people working around this?

Would this be a desirable addition to this gem? For example:

if ENV['RACK_ENV'] != 'production'
  Librato::Metrics.client = Librato::FakeClient.new(logger: ENV['RACK_ENV'] == 'test' ? nil : $stdout)
end

In the example above we define a fake client that logs the data submissions on development and nothing on test, replacing the 'real' client outside the production environment.

mateusduboli commented 9 years ago

+1

nextmat commented 9 years ago

This definitely seems like it would be useful to me.

badosu commented 9 years ago

So, I've been using Librato without credentials on development mode and so far nothing bad happened, I just would like to log all requests that Librato would send.

caarlos0 commented 8 years ago

++