braintree / manners

A polite Go HTTP server that shuts down gracefully.
MIT License
997 stars 103 forks source link

Make the number of currently running routines public #35

Closed dmathieu closed 8 years ago

dmathieu commented 8 years ago

It's always good to be able to monitor the number of currently running routines, to detect any leak or as a way to monitor capacity of an instance. This adds a server.CountRoutines so this data becomes public and can be used by any client.

lionelbarrow commented 8 years ago

Hey! Thanks for the contribution -- this looks like it could be useful to people.

Could you add a quick test that the counter works as expected? Maybe something that checks that the counter is 0 to start, that while running it's equal to the number of requests and 0 when the server shuts down.

lionelbarrow commented 8 years ago

Also, sorry that it took me so long to respond to this.

dmathieu commented 8 years ago

You're right. Done.

lionelbarrow commented 8 years ago

Merged. Thanks!

dmathieu commented 8 years ago

Thank you! :tulip: