mirror of
https://github.com/carrotquest/django-clickhouse.git
synced 2024-11-25 18:43:46 +03:00
Fixed statsd counters
This commit is contained in:
parent
6a1ffbadd3
commit
e8a15e4330
|
@ -199,7 +199,7 @@ class ClickHouseModel(with_metaclass(ClickHouseModelMeta, InfiModel)):
|
||||||
|
|
||||||
with statsd.timer(statsd_key.format('steps.get_operations')):
|
with statsd.timer(statsd_key.format('steps.get_operations')):
|
||||||
operations = storage.get_operations(import_key, cls.get_sync_batch_size())
|
operations = storage.get_operations(import_key, cls.get_sync_batch_size())
|
||||||
statsd.incr(statsd_key.format('operations', len(operations)))
|
statsd.incr(statsd_key.format('operations'), len(operations))
|
||||||
|
|
||||||
if operations:
|
if operations:
|
||||||
with statsd.timer(statsd_key.format('steps.get_sync_objects')):
|
with statsd.timer(statsd_key.format('steps.get_sync_objects')):
|
||||||
|
@ -207,7 +207,7 @@ class ClickHouseModel(with_metaclass(ClickHouseModelMeta, InfiModel)):
|
||||||
else:
|
else:
|
||||||
import_objects = []
|
import_objects = []
|
||||||
|
|
||||||
statsd.incr(statsd_key.format('import_objects', len(import_objects)))
|
statsd.incr(statsd_key.format('import_objects'), len(import_objects))
|
||||||
|
|
||||||
if import_objects:
|
if import_objects:
|
||||||
with statsd.timer(statsd_key.format('steps.get_insert_batch')):
|
with statsd.timer(statsd_key.format('steps.get_insert_batch')):
|
||||||
|
@ -264,7 +264,7 @@ class ClickHouseMultiModel(ClickHouseModel):
|
||||||
|
|
||||||
with statsd.timer(statsd_key.format('steps.get_operations')):
|
with statsd.timer(statsd_key.format('steps.get_operations')):
|
||||||
operations = storage.get_operations(import_key, cls.get_sync_batch_size())
|
operations = storage.get_operations(import_key, cls.get_sync_batch_size())
|
||||||
statsd.incr(statsd_key.format('operations', len(operations)))
|
statsd.incr(statsd_key.format('operations'), len(operations))
|
||||||
|
|
||||||
if operations:
|
if operations:
|
||||||
with statsd.timer(statsd_key.format('steps.get_sync_objects')):
|
with statsd.timer(statsd_key.format('steps.get_sync_objects')):
|
||||||
|
@ -272,7 +272,7 @@ class ClickHouseMultiModel(ClickHouseModel):
|
||||||
else:
|
else:
|
||||||
import_objects = []
|
import_objects = []
|
||||||
|
|
||||||
statsd.incr(statsd_key.format('import_objects', len(import_objects)))
|
statsd.incr(statsd_key.format('import_objects'), len(import_objects))
|
||||||
|
|
||||||
if import_objects:
|
if import_objects:
|
||||||
batches = {}
|
batches = {}
|
||||||
|
|
|
@ -117,6 +117,7 @@ class Storage:
|
||||||
% (operation, len(pks), import_key))
|
% (operation, len(pks), import_key))
|
||||||
|
|
||||||
statsd_key = "%s.sync.%s.register_operations" % (config.STATSD_PREFIX, import_key)
|
statsd_key = "%s.sync.%s.register_operations" % (config.STATSD_PREFIX, import_key)
|
||||||
|
statsd.incr(statsd_key + '.%s' % operation, len(pks))
|
||||||
with statsd.timer(statsd_key):
|
with statsd.timer(statsd_key):
|
||||||
return self.register_operations(import_key, operation, *pks)
|
return self.register_operations(import_key, operation, *pks)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user