You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the Rust thread pool library for writing metrics to the buffer asynchronously. The thread pool size would be user controlled and passed to the sink that makes use of it. Each call to MetricSink.emit would submit a task to the thread pool.
It's looking like this will just be an AsyncMetricSink that writes metrics to another sink in a thread. It will have no knowledge of buffering or whatnot and just delegate to another sink. It might make sense to go back and change BufferedUdpMetricSink to just do buffering, not have direct knowledge that it is writing to a UDP socket.
Given that Sender and ThreadPool can't be shared between threads, the async metric sink is going to require a slightly different use case. We should create some examples (in docs and code) showing how you could safely use both the async version and plain buffered version.
Create MetricSink implementation that wraps another metric sink to
emit metrics using worker threads in a thread pool.
As part of making the AsyncMetricSink easy to share between threads,
all sinks now implement reasonable `Clone` behavior. This means for
the UDP sinks that the underlying sockets (or mutex / buffers) are
wrapped in an Arc (Atomic reference count) instance. This allows
the same socket to be shared between threads and still properly
cleaned up.
Fixes#23
Use the Rust thread pool library for writing metrics to the buffer asynchronously. The thread pool size would be user controlled and passed to the sink that makes use of it. Each call to
MetricSink.emit
would submit a task to the thread pool.Questions:
BufferedUdpMetricSink
from Investigate buffered MetricSink implementation #18?The text was updated successfully, but these errors were encountered: