def email_changed(): write_points([{ 'measurement': 'karrot.events', 'fields': { 'email_changed': 1, }, }])
def password_reset_successful(): write_points([{ 'measurement': 'karrot.events', 'fields': { 'password_reset_successful': 1, }, }])
def account_deletion_successful(): write_points([{ 'measurement': 'karrot.events', 'fields': { 'account_deletion_successful': 1, }, }])
def password_changed(): write_points([{ 'measurement': 'karrot.events', 'fields': { 'password_changed': 1, }, }])
def account_deletion_requested(): write_points([{ 'measurement': 'karrot.events', 'fields': { 'account_deletion_requested': 1, }, }])
def incoming_email_rejected(): write_points([{ 'measurement': 'karrot.events', 'fields': { 'incoming_email_rejected': 1, }, }])
def password_reset_requested(): write_points([{ 'measurement': 'karrot.events', 'fields': { 'password_reset_requested': 1, }, }])
def vote_deleted(issue): write_points([{ 'measurement': 'karrot.events', 'tags': issue_tags(issue), 'fields': { 'issue_vote_deleted': 1 }, }])
def pickup_notification_email(group, **kwargs): write_points([{ 'measurement': 'karrot.email.pickup_notification', 'tags': { 'group': str(group.id) }, 'fields': {'value': 1, **kwargs}, }])
def verification_code_failed(reason): write_points([{ 'measurement': 'karrot.events', 'fields': { 'verification_code_{}'.format(reason): 1, 'verification_code_failed': 1, }, }])
def group_activity(group): write_points([{ 'measurement': 'karrot.events', 'tags': group_tags(group), 'fields': { 'group_activity': 1 }, }])
def pickup_missed(pickup): write_points([{ 'measurement': 'karrot.pickup.missed', 'tags': pickup_tags(pickup), 'fields': { 'value': 1 }, }])
def trust_given(group): write_points([{ 'measurement': 'karrot.events', 'tags': group_tags(group), 'fields': { 'trust_given': 1 }, }])
def notification_created(notification): write_points([{ 'measurement': 'karrot.events', 'tags': notification_tags(notification), 'fields': { 'notification_created': 1 }, }])
def feedback_given(feedback): write_points([{ 'measurement': 'karrot.events', 'tags': pickup_tags(feedback.about), 'fields': { 'feedback': 1 }, }])
def email_sent(recipient_count): write_points([{ 'measurement': 'karrot.email.sent', 'fields': { 'value': 1, 'recipient_count': recipient_count }, }])
def reaction_given(reaction): write_points([{ 'measurement': 'karrot.events', 'tags': conversation_tags(reaction.message.conversation), 'fields': { 'message_reaction': 1 }, }])
def invitation_created(invitation): write_points([{ 'measurement': 'karrot.events', 'tags': group_tags(invitation.group), 'fields': { 'invitation_created': 1 }, }])
def offer_created(offer): write_points([{ 'measurement': 'karrot.events', 'tags': offer_tags(offer), 'fields': { 'offer_created': 1 }, }])
def member_became_editor(group): write_points([{ 'measurement': 'karrot.events', 'tags': group_tags(group), 'fields': { 'member_became_editor': 1 }, }])
def pickup_enabled(pickup): write_points([{ 'measurement': 'karrot.events', 'tags': pickup_tags(pickup), 'fields': { 'pickup_enabled': 1 }, }])
def record_user_stats(): stats_utils.periodic_task('users__record_user_stats') fields = get_users_stats() write_points([{ 'measurement': 'karrot.users', 'fields': fields, }])
def group_summary_email(group, **extra_fields): write_points([{ 'measurement': 'karrot.email.group_summary', 'tags': group_tags(group), 'fields': { 'value': 1, **extra_fields }, }])
def login_failed(email): write_points([{ 'measurement': 'django_auth_user_login_failed', # mimic existing stats from django-influxdb-metrics 'fields': { 'value': 1, 'email': email, }, }])
def group_joined(group): write_points([{ 'measurement': 'karrot.group.joined', 'tags': { 'group': str(group.id) }, 'fields': { 'value': 1 }, }])
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)
def group_left(group): write_points([{ 'measurement': 'karrot.events', 'tags': { 'group': str(group.id) }, 'fields': { 'group_left': 1 }, }])
def group_activity(group): write_points([{ 'measurement': 'karrot.group.activity', 'tags': { 'group': str(group.id) }, 'fields': { 'value': 1 }, }])
def periodic_task(name): write_points([{ 'measurement': 'karrot.periodic', 'tags': { 'name': name, }, 'fields': { 'value': 1, }, }])
def pushed_via_websocket(topic): write_points([{ 'measurement': 'karrot.events', 'tags': { 'topic': topic, }, 'fields': { 'websocket_push': 1 }, }])