def user_post_delete_handler(sender, **kwargs):
    """Sends a metric to InfluxDB when a User object is deleted."""
    total = get_user_model().objects.all().count()
    data = [{
        'measurement': 'django_auth_user_delete',
        'tags': {'host': settings.INFLUXDB_TAGS_HOST, },
        'fields': {'value': 1, },
        'time': timezone.now().isoformat(),
    }]
    write_points(data)

    data = [{
        'measurement': 'django_auth_user_count',
        'tags': {'host': settings.INFLUXDB_TAGS_HOST, },
        'fields': {'value': total, },
        'time': timezone.now().isoformat(),
    }]
    write_points(data)
def user_post_delete_handler ( sender , ** kwargs ) : total = get_user_model ( ) . objects . all ( ) . count ( ) data = [ { 'measurement' : 'django_auth_user_delete' , 'tags' : { 'host' : settings . INFLUXDB_TAGS_HOST , } , 'fields' : { 'value' : 1 , } , 'time' : timezone . now ( ) . isoformat ( ) , } ] write_points ( data ) data = [ { 'measurement' : 'django_auth_user_count' , 'tags' : { 'host' : settings . INFLUXDB_TAGS_HOST , } , 'fields' : { 'value' : total , } , 'time' : timezone . now ( ) . isoformat ( ) , } ] write_points ( data )
Sends a metric to InfluxDB when a User object is deleted.