Skip to content

Commit

Permalink
ignore large memberbucks balances for stats
Browse files Browse the repository at this point in the history
  • Loading branch information
jabelone committed Jul 2, 2024
1 parent 9e6a5b0 commit 4680590
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion memberportal/api_metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ def calculate_subscription_count():

def calculate_memberbucks_balance():
logger.debug("Calculating memberbucks balance total")
total_balance = Profile.objects.aggregate(Sum("memberbucks_balance"))
total_balance = Profile.objects.filter(memberbucks_balance__lt=1000).aggregate(
Sum("memberbucks_balance")
)
Metric.objects.create(
name=Metric.MetricName.MEMBERBUCKS_BALANCE_TOTAL,
data={"value": total_balance["memberbucks_balance__sum"]},
Expand Down

0 comments on commit 4680590

Please sign in to comment.