mirror of
https://github.com/carrotquest/django-clickhouse.git
synced 2024-11-22 00:56:37 +03:00
Measure time for inserting tuples
This commit is contained in:
parent
df422d11f1
commit
ef6fc46c5c
|
@ -113,10 +113,11 @@ class Database(InfiDatabase):
|
|||
|
||||
# Return any remaining lines in partial batch
|
||||
if lines:
|
||||
statsd.incr(statsd_key.format('insert_batch'), count=lines)
|
||||
statsd.incr(statsd_key, lines)
|
||||
yield buf.getvalue()
|
||||
|
||||
self._send(gen())
|
||||
with statsd.timer(statsd_key):
|
||||
self._send(next(gen()))
|
||||
|
||||
|
||||
class ConnectionProxy:
|
||||
|
|
|
@ -27,7 +27,7 @@ class ClickHouseCollapseTestModel(ClickHouseModel):
|
|||
id = fields.Int32Field()
|
||||
created = fields.DateTimeField()
|
||||
value = fields.Int32Field()
|
||||
sign = fields.Int8Field()
|
||||
sign = fields.Int8Field(default=1)
|
||||
version = fields.Int8Field(default=1)
|
||||
|
||||
engine = CollapsingMergeTree('created', ('id',), 'sign')
|
||||
|
|
Loading…
Reference in New Issue
Block a user