From 241618d8ca4ac1de7fd2b25012c7f4ffd3dd032d Mon Sep 17 00:00:00 2001 From: M1ha Date: Wed, 23 Jan 2019 12:48:18 +0500 Subject: [PATCH] Test if post_save is called --- src/django_clickhouse/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/django_clickhouse/models.py b/src/django_clickhouse/models.py index 2dd8ea9..0f89239 100644 --- a/src/django_clickhouse/models.py +++ b/src/django_clickhouse/models.py @@ -10,6 +10,7 @@ from django.db import transaction from django.db.models.signals import post_save, post_delete from django.dispatch import receiver from django.db.models import QuerySet as DjangoQuerySet, Manager as DjangoManager, Model as DjangoModel +from statsd.defaults.django import statsd from .configuration import config from .storages import Storage @@ -193,6 +194,7 @@ class ClickHouseSyncModel(DjangoModel): @receiver(post_save) def post_save(sender, instance, **kwargs): + statsd.incr('clickhouse.sync.post_save'.format('post_save'), 1) if issubclass(sender, ClickHouseSyncModel): instance.post_save(kwargs.get('created', False), using=kwargs.get('using'))