Measure time for inserting tuples

This commit is contained in:
M1ha 2019-02-05 15:17:37 +05:00
parent ef6fc46c5c
commit 4249b0e2b9

View File

@ -116,8 +116,10 @@ class Database(InfiDatabase):
statsd.incr(statsd_key, lines) statsd.incr(statsd_key, lines)
yield buf.getvalue() yield buf.getvalue()
with statsd.timer(statsd_key): # For testing purposes
self._send(next(gen())) for data in gen():
with statsd.timer(statsd_key):
self._send(data)
class ConnectionProxy: class ConnectionProxy: