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

Long living client #44

Closed
iarief opened this issue Jan 4, 2018 · 3 comments
Closed

Long living client #44

iarief opened this issue Jan 4, 2018 · 3 comments

Comments

@iarief
Copy link

iarief commented Jan 4, 2018

Hi, is it possible to call statsd.new only once and reuse that client for the whole application lifetime?

I seem to randomly run into sigsegv: segmentation violation panic on client.push after a few hour of running my application.

I'm using a singleton pattern with sync.once, if that helps

@renak
Copy link

renak commented Apr 24, 2018

I'm new to statsd and I'm thinking of using this package. Is this an issue I should be concerned about? I was thinking of possibly writing a wrapper around this and passing the wrapper around to different parts of my project. Would I need to periodically refresh the client instance? Or is it expected that a new client instance should be created for each metric call?

@arbll
Copy link
Member

arbll commented Apr 11, 2019

Hey there,

One instance can definitely be used for all your application and this library is commonly used that way. A singleton pattern would do the job.

@iarief do you have more details on your sigsegv ?

@arbll
Copy link
Member

arbll commented Jun 21, 2019

Going to close this one, feel free to re-open if needed.

@arbll arbll closed this as completed Jun 21, 2019
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

No branches or pull requests

3 participants