Record statistics for event queues

(imported from commit 88f30a33f0717d5ad1b22a86cf311d7b67c69bf5)
This commit is contained in:
Zev Benjamin 2013-04-01 16:58:24 -04:00
parent a73e2975d7
commit 4a8d8e6fb4
1 changed files with 3 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import sys
import signal
import tornado
import random
import zephyr.lib.stats as stats
IDLE_EVENT_QUEUE_TIMEOUT_SECS = 60 * 10
# The heartbeats effectively act as a server-side timeout for
@ -147,6 +148,8 @@ def gc_event_queues():
+ ' Now %d active queues')
% (len(to_remove), len(affected_users), time.time() - start,
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__),
"..", "..", "event_queues.pickle")