Commit 090288ad17e733bb0add524d647cc2f1e7ef3954
1 parent
240466132b
Exists in
master
dumpStats
Showing 1 changed file with 10 additions and 0 deletions Side-by-side Diff
... | ... | @@ -10,6 +10,15 @@ var redisClient; |
10 | 10 | |
11 | 11 | var resendHandlers = LRU({max: 2000, maxAge: 1000 * 3600 * 36}); |
12 | 12 | |
13 | +function dumpStats() { | |
14 | + if (config.globals.auto_resend_on_delay_secs) { | |
15 | + logger.verbose('DUMP STATS', { | |
16 | + 'resendHandlers:length': resendHandlers.length, | |
17 | + 'resendHandlers:itemCount': resendHandlers.itemCount, | |
18 | + }); | |
19 | + } | |
20 | +} | |
21 | + | |
13 | 22 | function init(options) { |
14 | 23 | if (options && options.config) { |
15 | 24 | config = options.config; |
... | ... | @@ -21,6 +30,7 @@ function init(options) { |
21 | 30 | |
22 | 31 | createRedisClient(config.globals.redis_host, config.globals.redis_port); |
23 | 32 | readImConfig(); |
33 | + setInterval(dumpStats, 1000 * 300); | |
24 | 34 | } |
25 | 35 | |
26 | 36 | function createRedisClient(host, port) { |