queue: Log how long it takes to connect to rabbitmq.

(imported from commit be3cd9da5e7c213cfed62feda2e676038ade57a6)
This commit is contained in:
Tim Abbott
2013-09-30 13:40:24 -04:00
parent 3d1fd4a1e9
commit 0e23b2240d

View File

@@ -25,9 +25,10 @@ class SimpleQueueClient(object):
self._connect()
def _connect(self):
start = time.time()
self.connection = pika.BlockingConnection(self._get_parameters())
self.channel = self.connection.channel()
self.log.info('SimpleQueueClient connected')
self.log.info('SimpleQueueClient connected (connecting took %.3fs)' % (time.time() - start,))
def _reconnect(self):
self.connection = None