Code Monkey home page Code Monkey logo

Comments (4)

nextmat avatar nextmat commented on July 17, 2024

@lucasmartins Great. If you are only sending metrics in your tests there actually is a test mode already although it isn't currently documented. You can just set your classes up to use the test persistor and metrics will be written to memory instead of being sent to Librato.

Here's an example of how we use that internally.

Alternately if you want to stub other requests since we're using faraday under the hood you should be able to use the faraday stub support.

You can assign a default faraday adapter for use with Librato::Metrics.faraday_adapter= or specify it per client object. I haven't actually used this for stub support yet but it should either work or be a pretty trivial code change to get it working.

All of that said we definitely welcome improvements in any form. A PR to improve testability or improve documentation around how the library works for testing would be great!

from librato-metrics.

nextmat avatar nextmat commented on July 17, 2024

Just wanted to follow back up on this. Any further thoughts?

from librato-metrics.

lucasmartins avatar lucasmartins commented on July 17, 2024

Sorry, I've lost myself at the notification page.

The test persistor looks perfect for my case, I've overridden some Librato methods for the time being, but I'm looking forward to chage my code to use this.

Thanks a lot for the reply, when I change my code I'll write something for the Wiki.

Cheers!

from librato-metrics.

nextmat avatar nextmat commented on July 17, 2024

Great, sounds good!

from librato-metrics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.