mperham / connection_pool

Generic connection pooling for Ruby
MIT License
1.63k stars 143 forks source link

Instrumenting checkout and query times? #86

Closed jeffblake closed 4 years ago

jeffblake commented 8 years ago

I'm trying to set up a scheduler that measures the average time it takes to checkout a connection from the pool, and the query time spent while using it, and logging that to $stdout in a format Librato can understand. Can this be done? Or even better, ActiveSupport::Notification support, or some sort of generic LogSubscriber.

guyisra commented 7 years ago

Instrumenting the connection pool usage would also be nice, so we can check if the connection pool is too big or too small

atomical commented 6 years ago

Do either of you guys have an example of checking connection health?

mmontagna commented 6 years ago

@atomical I've forked the gem and added the ability to add an arbitrary connection health check here https://github.com/mmontagna/healthy_pools

florrain commented 6 years ago

Also interested in instrumenting the GEM, anybody have pointers?

atomical commented 4 years ago

@florrain I wrote a wrapper for TinyTDS that disconnects and reconnects when exceptions are raised. It can be used with connection pooling gems.