-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add option to track MAU stats (but not limit people) #3830
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@turt2live please can you fix the conflict and the test failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks plausible to me, though since @neilisfragile wrote most of this code it might be sensible for him to take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, my only ask is some tests to prove the logic - either in test/store/test_monthly_active_users or in the more integration-y test like test/test_mau.py
@@ -235,8 +235,12 @@ def populate_monthly_active_users(self, user_id): | |||
# but only update if we have not previously seen the user for | |||
# LAST_SEEN_GRANULARITY ms | |||
if last_seen_timestamp is None: | |||
count = yield self.get_monthly_active_count() | |||
if count < self.hs.config.max_mau_value: | |||
# Optimize the db usage when not limiting usage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to look at it a few times to understand the intent - I'm not sure I can suggest a more expressive way to do via code, but a more descriptive comment would be helpful.
I'm not sure it will necessarily help a great deal with db load since get_monthly_active_count is cached but the logic expects max_mau_value to be set and so I agree that it needs the if check.
Perhaps something like
"In the case where mau_stats_only is True and limit_usage_by_mau is False, there is no point in checking get_monthly_active_count - it adds no value and will break the logic if max_mau_value is exceeded "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to look at it a few times to understand the intent
(I had the same reaction tbh)
(fixed a conflict, haven't addressed anything else - will poke it Soon) |
This was done with an unpaid hat on: Signed-off-by: Travis Ralston travpc@gmail.com |
LGTM you happy @richvdh? |
I'd love to have this functionality, can we get this merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
No description provided.