Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@snikch
Copy link
Contributor

@snikch snikch commented May 26, 2016

Currently if you respond with a status code that doesn't explicitly have a counter set, you'll get a panic.

@mihasya
Copy link
Collaborator

mihasya commented Jun 4, 2016

Hmm I'm not sure this is really what we want happening - the next person that comes along and has the same issue you had with 422 is just going to get a silent failure and no metrics. I'm inclined to think the panic is actually the right outcome here - lets you know the counter implementation doesn't know the code you're trying to return, and the fix seems straight-forward enough.

@snikch
Copy link
Contributor Author

snikch commented Jun 6, 2016

Very true. After realising that these are counters rather than meters we implemented our own version where we create a meter on demand for each status type. This reduces the amount of meters any one consumer will have, as I'd imagine not everyone is using all of the status codes, but also added a little bit more complexity with a mutex to prevent concurrency clobbering when initializing a meter.

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.

2 participants