Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create BufferedUdpMetricSink that buffers metric lines before sending #22

Merged
merged 1 commit into from
Aug 6, 2016

Conversation

56quarters
Copy link
Owner

New MetricSink implementation that buffers metrics sent to it up to a certain
size (user configurable) before sending via a UDP socket. Each metric is written
to a shared (mutex guarded) buffer along with a trailing newline (\n). When the
buffer cannot fit the next metric, it will be flushed.

Metrics that are too large for the buffer (unlikely but possible) will be written
directly to the underlying socket.

Current limitations:

  • Mutex poisoning is not handled. It has the potential to panic the thread.
  • Metrics are still written to the socket in the calling thread.

Fixes #18

New MetricSink implementation that buffers metrics sent to it up to a certain
size (user configurable) before sending via a UDP socket. Each metric is written
to a shared (mutex guarded) buffer along with a trailing newline (\n). When the
buffer cannot fit the next metric, it will be flushed.

Metrics that are too large for the buffer (unlikely but possible) will be written
directly to the underlying socket.

Current limitations:

* Mutex poisoning is not handled. It has the potential to panic the thread.
* Metrics are still written to the socket in the calling thread.

Fixes #18
@56quarters 56quarters merged commit 95b38ba into master Aug 6, 2016
@56quarters 56quarters deleted the buffered branch August 6, 2016 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant