Code Monkey home page Code Monkey logo

Comments (2)

56quarters avatar 56quarters commented on July 17, 2024 1

But in situations where the environment is only sparsely used, metrics can sit in the buffer for arbitrarily long durations.

Yes, it's possible for metrics to sit in the buffer for a while. I can't think of a good way around this that doesn't involve more complexity than the sink itself. In this case, I think the prudent thing is for users to use the UdpMetricSink instead since they presumably don't have a lot of metrics being emitted to necessitate buffering. Where do you think a good place to document this tradeoff is? Perhaps in the docs for each of the sinks? Or the main lib docs (lib.rs + README)?

A similar (but potentially more pressing) issue is that BufferedUdpMetricSink has no way to flush the contents of its buffer when dropped, making data loss inevitable.

The BufferedUdpMetricSink doesn't flush on drop explicitly but the underlying BufWriter that our write adapter uses, does: https://github.com/tshlabs/cadence/blob/4edb69ca281dfbb4651d26d4266cc6c4307c5943/src/io.rs#L215

from cadence.

parasyte avatar parasyte commented on July 17, 2024 1

Glad to see the writer will flush itself.

I suppose the environmental edge case can be handled with a configuration flag, so this isn't a showstopper either. If anything, I would probably document this behavior on BufferedUdpMetricSink, and maybe mention it in passing on the README where this type is introduced. I think that would sufficiently resolve this ticket!

from cadence.

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.