mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 09:27:43 +00:00
Record statistics for event queues
(imported from commit 88f30a33f0717d5ad1b22a86cf311d7b67c69bf5)
This commit is contained in:
@@ -12,6 +12,7 @@ import sys
|
|||||||
import signal
|
import signal
|
||||||
import tornado
|
import tornado
|
||||||
import random
|
import random
|
||||||
|
import zephyr.lib.stats as stats
|
||||||
|
|
||||||
IDLE_EVENT_QUEUE_TIMEOUT_SECS = 60 * 10
|
IDLE_EVENT_QUEUE_TIMEOUT_SECS = 60 * 10
|
||||||
# The heartbeats effectively act as a server-side timeout for
|
# The heartbeats effectively act as a server-side timeout for
|
||||||
@@ -147,6 +148,8 @@ def gc_event_queues():
|
|||||||
+ ' Now %d active queues')
|
+ ' Now %d active queues')
|
||||||
% (len(to_remove), len(affected_users), time.time() - start,
|
% (len(to_remove), len(affected_users), time.time() - start,
|
||||||
len(clients)))
|
len(clients)))
|
||||||
|
stats.update_stat('tornado.active_queues', len(clients))
|
||||||
|
stats.update_stat('tornado.active_users', len(user_clients))
|
||||||
|
|
||||||
PERSISTENT_QUEUE_FILENAME = os.path.join(os.path.dirname(__file__),
|
PERSISTENT_QUEUE_FILENAME = os.path.join(os.path.dirname(__file__),
|
||||||
"..", "..", "event_queues.pickle")
|
"..", "..", "event_queues.pickle")
|
||||||
|
|||||||
Reference in New Issue
Block a user