Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Fake Metrics Client #113

Open
badosu opened this issue Nov 11, 2015 · 4 comments
Open

Fake Metrics Client #113

badosu opened this issue Nov 11, 2015 · 4 comments

Comments

@badosu
Copy link

badosu commented Nov 11, 2015

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
Copy link

+1

@nextmat
Copy link
Contributor

nextmat commented Nov 13, 2015

This definitely seems like it would be useful to me.

@badosu
Copy link
Author

badosu commented Nov 13, 2015

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
Copy link

++

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants