mirror of
https://github.com/carrotquest/django-clickhouse.git
synced 2024-11-15 05:46:41 +03:00
1) Fixed get_final_versions statsd timer key
2) Added individual model operations statsd monitoring for ClickHouseMultiModel
This commit is contained in:
parent
96b625ecff
commit
6a4bf14ea6
|
@ -282,10 +282,14 @@ class ClickHouseMultiModel(ClickHouseModel):
|
|||
batches = {}
|
||||
with statsd.timer(statsd_key.format('steps.get_insert_batch')):
|
||||
for model_cls in cls.sub_models:
|
||||
model_statsd_key = "%s.sync.%s.{0}" % (config.STATSD_PREFIX, model_cls.__name__)
|
||||
with statsd.timer(model_statsd_key.format('steps.get_insert_batch')):
|
||||
batches[model_cls] = model_cls.get_insert_batch(import_objects)
|
||||
|
||||
with statsd.timer(statsd_key.format('steps.insert')):
|
||||
for model_cls, batch in batches.items():
|
||||
model_statsd_key = "%s.sync.%s.{0}" % (config.STATSD_PREFIX, model_cls.__name__)
|
||||
with statsd.timer(model_statsd_key.format('steps.insert')):
|
||||
model_cls.insert_batch(batch)
|
||||
|
||||
with statsd.timer(statsd_key.format('steps.post_sync')):
|
||||
|
|
|
@ -129,7 +129,7 @@ class CollapsingMergeTree(InsertOnlyEngineMixin, infi_engines.CollapsingMergeTre
|
|||
"""
|
||||
new_objs = super(CollapsingMergeTree, self).get_insert_batch(model_cls, objects)
|
||||
|
||||
statsd_key = "%s.sync.%s.get_final_versions" % (config.STATSD_PREFIX, model_cls.__name__)
|
||||
statsd_key = "%s.sync.%s.steps.get_final_versions" % (config.STATSD_PREFIX, model_cls.__name__)
|
||||
with statsd.timer(statsd_key):
|
||||
old_objs = self.get_final_versions(model_cls, new_objs)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user