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

Add librato logging #37

Merged
merged 2 commits into from
Aug 21, 2017
Merged

Add librato logging #37

merged 2 commits into from
Aug 21, 2017

Conversation

nicpottier
Copy link
Collaborator

I looked at a bunch of libraries to do this but they were all sucky in one way or another. Boo.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.4%) to 76.783% when pulling b330039 on librato into 2c141b9 on master.

}

// our buffer is full, log an error but continue
if len(c.buffer) >= cap(c.buffer) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be behind a mutex so two threads can't both get the all clear to to add to the buffer when it's only got room for one more item?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but the idea is to avoid mutexes as much as possible with channels. We really should never reach this point as the buffer size should keep us ahead. If for some reason we do go beyond this, what will happen is the push unto the channel will block until our other goroutine flushes, so it isn't the end of the world.

@nicpottier nicpottier merged commit 1574133 into master Aug 21, 2017
@nicpottier nicpottier deleted the librato branch August 21, 2017 22:14
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.5%) to 76.694% when pulling 5495a48 on librato into 2c141b9 on master.

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.

3 participants