From 4249b0e2b91b0c7e706ba575e013f449212864e3 Mon Sep 17 00:00:00 2001 From: M1ha Date: Tue, 5 Feb 2019 15:17:37 +0500 Subject: [PATCH] Measure time for inserting tuples --- src/django_clickhouse/database.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/django_clickhouse/database.py b/src/django_clickhouse/database.py index 69f9de3..aa0e8b2 100644 --- a/src/django_clickhouse/database.py +++ b/src/django_clickhouse/database.py @@ -116,8 +116,10 @@ class Database(InfiDatabase): statsd.incr(statsd_key, lines) yield buf.getvalue() - with statsd.timer(statsd_key): - self._send(next(gen())) + # For testing purposes + for data in gen(): + with statsd.timer(statsd_key): + self._send(data) class ConnectionProxy: