mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
counts.py: Reorder count_stats_ to put similar stats together.
This commit is contained in:
@@ -418,8 +418,6 @@ def do_pull_minutes_active(stat, start_time, end_time):
|
|||||||
(stat.property, (time.time()-timer_start)*1000, len(rows)))
|
(stat.property, (time.time()-timer_start)*1000, len(rows)))
|
||||||
|
|
||||||
count_stats_ = [
|
count_stats_ = [
|
||||||
CountStat('active_users:is_bot:day', zerver_count_user_by_realm, {'is_active': True},
|
|
||||||
(UserProfile, 'is_bot'), CountStat.DAY, interval=TIMEDELTA_MAX),
|
|
||||||
CountStat('messages_sent:is_bot:hour', zerver_count_message_by_user, {},
|
CountStat('messages_sent:is_bot:hour', zerver_count_message_by_user, {},
|
||||||
(UserProfile, 'is_bot'), CountStat.HOUR),
|
(UserProfile, 'is_bot'), CountStat.HOUR),
|
||||||
CountStat('messages_sent:message_type:day', zerver_count_message_type_by_user, {},
|
CountStat('messages_sent:message_type:day', zerver_count_message_type_by_user, {},
|
||||||
@@ -428,11 +426,15 @@ count_stats_ = [
|
|||||||
(Message, 'sending_client_id'), CountStat.DAY),
|
(Message, 'sending_client_id'), CountStat.DAY),
|
||||||
CountStat('messages_in_stream:is_bot:day', zerver_count_message_by_stream, {},
|
CountStat('messages_in_stream:is_bot:day', zerver_count_message_by_stream, {},
|
||||||
(UserProfile, 'is_bot'), CountStat.DAY),
|
(UserProfile, 'is_bot'), CountStat.DAY),
|
||||||
|
|
||||||
|
CountStat('active_users:is_bot:day', zerver_count_user_by_realm, {'is_active': True},
|
||||||
|
(UserProfile, 'is_bot'), CountStat.DAY, interval=TIMEDELTA_MAX),
|
||||||
|
LoggingCountStat('active_users_log:is_bot:day', RealmCount, CountStat.DAY),
|
||||||
|
|
||||||
# The minutes=15 part is due to the 15 minutes added in
|
# The minutes=15 part is due to the 15 minutes added in
|
||||||
# zerver.lib.actions.do_update_user_activity_interval.
|
# zerver.lib.actions.do_update_user_activity_interval.
|
||||||
CountStat('15day_actives::day', zerver_check_useractivityinterval_by_user, {},
|
CountStat('15day_actives::day', zerver_check_useractivityinterval_by_user, {},
|
||||||
None, CountStat.DAY, interval=timedelta(days=15)-timedelta(minutes=15)),
|
None, CountStat.DAY, interval=timedelta(days=15)-timedelta(minutes=15)),
|
||||||
LoggingCountStat('active_users_log:is_bot:day', RealmCount, CountStat.DAY),
|
|
||||||
CustomPullCountStat('minutes_active::day', UserCount, CountStat.DAY, do_pull_minutes_active)
|
CustomPullCountStat('minutes_active::day', UserCount, CountStat.DAY, do_pull_minutes_active)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user