Пример #1
0
def email_changed():
    write_points([{
        'measurement': 'karrot.events',
        'fields': {
            'email_changed': 1,
        },
    }])
Пример #2
0
def password_reset_successful():
    write_points([{
        'measurement': 'karrot.events',
        'fields': {
            'password_reset_successful': 1,
        },
    }])
Пример #3
0
def account_deletion_successful():
    write_points([{
        'measurement': 'karrot.events',
        'fields': {
            'account_deletion_successful': 1,
        },
    }])
Пример #4
0
def password_changed():
    write_points([{
        'measurement': 'karrot.events',
        'fields': {
            'password_changed': 1,
        },
    }])
Пример #5
0
def account_deletion_requested():
    write_points([{
        'measurement': 'karrot.events',
        'fields': {
            'account_deletion_requested': 1,
        },
    }])
Пример #6
0
def incoming_email_rejected():
    write_points([{
        'measurement': 'karrot.events',
        'fields': {
            'incoming_email_rejected': 1,
        },
    }])
Пример #7
0
def password_reset_requested():
    write_points([{
        'measurement': 'karrot.events',
        'fields': {
            'password_reset_requested': 1,
        },
    }])
Пример #8
0
def vote_deleted(issue):
    write_points([{
        'measurement': 'karrot.events',
        'tags': issue_tags(issue),
        'fields': {
            'issue_vote_deleted': 1
        },
    }])
Пример #9
0
def pickup_notification_email(group, **kwargs):
    write_points([{
        'measurement': 'karrot.email.pickup_notification',
        'tags': {
            'group': str(group.id)
        },
        'fields': {'value': 1, **kwargs},
    }])
Пример #10
0
def verification_code_failed(reason):
    write_points([{
        'measurement': 'karrot.events',
        'fields': {
            'verification_code_{}'.format(reason): 1,
            'verification_code_failed': 1,
        },
    }])
Пример #11
0
def group_activity(group):
    write_points([{
        'measurement': 'karrot.events',
        'tags': group_tags(group),
        'fields': {
            'group_activity': 1
        },
    }])
Пример #12
0
def pickup_missed(pickup):
    write_points([{
        'measurement': 'karrot.pickup.missed',
        'tags': pickup_tags(pickup),
        'fields': {
            'value': 1
        },
    }])
Пример #13
0
def trust_given(group):
    write_points([{
        'measurement': 'karrot.events',
        'tags': group_tags(group),
        'fields': {
            'trust_given': 1
        },
    }])
Пример #14
0
def notification_created(notification):
    write_points([{
        'measurement': 'karrot.events',
        'tags': notification_tags(notification),
        'fields': {
            'notification_created': 1
        },
    }])
Пример #15
0
def feedback_given(feedback):
    write_points([{
        'measurement': 'karrot.events',
        'tags': pickup_tags(feedback.about),
        'fields': {
            'feedback': 1
        },
    }])
Пример #16
0
def email_sent(recipient_count):
    write_points([{
        'measurement': 'karrot.email.sent',
        'fields': {
            'value': 1,
            'recipient_count': recipient_count
        },
    }])
Пример #17
0
def reaction_given(reaction):
    write_points([{
        'measurement': 'karrot.events',
        'tags': conversation_tags(reaction.message.conversation),
        'fields': {
            'message_reaction': 1
        },
    }])
Пример #18
0
def invitation_created(invitation):
    write_points([{
        'measurement': 'karrot.events',
        'tags': group_tags(invitation.group),
        'fields': {
            'invitation_created': 1
        },
    }])
Пример #19
0
def offer_created(offer):
    write_points([{
        'measurement': 'karrot.events',
        'tags': offer_tags(offer),
        'fields': {
            'offer_created': 1
        },
    }])
Пример #20
0
def member_became_editor(group):
    write_points([{
        'measurement': 'karrot.events',
        'tags': group_tags(group),
        'fields': {
            'member_became_editor': 1
        },
    }])
Пример #21
0
def pickup_enabled(pickup):
    write_points([{
        'measurement': 'karrot.events',
        'tags': pickup_tags(pickup),
        'fields': {
            'pickup_enabled': 1
        },
    }])
Пример #22
0
def record_user_stats():
    stats_utils.periodic_task('users__record_user_stats')

    fields = get_users_stats()

    write_points([{
        'measurement': 'karrot.users',
        'fields': fields,
    }])
Пример #23
0
def group_summary_email(group, **extra_fields):
    write_points([{
        'measurement': 'karrot.email.group_summary',
        'tags': group_tags(group),
        'fields': {
            'value': 1,
            **extra_fields
        },
    }])
Пример #24
0
def login_failed(email):
    write_points([{
        'measurement':
        'django_auth_user_login_failed',  # mimic existing stats from django-influxdb-metrics
        'fields': {
            'value': 1,
            'email': email,
        },
    }])
Пример #25
0
def group_joined(group):
    write_points([{
        'measurement': 'karrot.group.joined',
        'tags': {
            'group': str(group.id)
        },
        'fields': {
            'value': 1
        },
    }])
Пример #26
0
def record_group_stats():
    stats.periodic_task('group__record_group_stats')

    points = []

    for group in Group.objects.all():
        points.extend(stats.get_group_members_stats(group))
        points.extend(stats.get_group_stores_stats(group))

    write_points(points)
Пример #27
0
def group_left(group):
    write_points([{
        'measurement': 'karrot.events',
        'tags': {
            'group': str(group.id)
        },
        'fields': {
            'group_left': 1
        },
    }])
Пример #28
0
def group_activity(group):
    write_points([{
        'measurement': 'karrot.group.activity',
        'tags': {
            'group': str(group.id)
        },
        'fields': {
            'value': 1
        },
    }])
Пример #29
0
def periodic_task(name):
    write_points([{
        'measurement': 'karrot.periodic',
        'tags': {
            'name': name,
        },
        'fields': {
            'value': 1,
        },
    }])
Пример #30
0
def pushed_via_websocket(topic):
    write_points([{
        'measurement': 'karrot.events',
        'tags': {
            'topic': topic,
        },
        'fields': {
            'websocket_push': 1
        },
    }])