Software /
code /
prosody-modules
Comparison
mod_statistics/stats.lib.lua @ 1080:3af947e2e6d4
mod_statistics/stats.lib.lua: Only fetch shared tables if running under Prosody
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 15 Jun 2013 21:17:09 +0100 |
parent | 1077:b73d44afdafa |
child | 1081:3e2c4f424797 |
comparison
equal
deleted
inserted
replaced
1079:87a091f88a1d | 1080:3af947e2e6d4 |
---|---|
25 | 25 |
26 local last_cpu_wall, last_cpu_clock; | 26 local last_cpu_wall, last_cpu_clock; |
27 local get_time = require "socket".gettime; | 27 local get_time = require "socket".gettime; |
28 | 28 |
29 local active_sessions, active_jids = {}, {}; | 29 local active_sessions, active_jids = {}, {}; |
30 local s2s_sessions = module:shared"/*/s2s/sessions"; | 30 local c2s_sessions, s2s_sessions; |
31 local c2s_sessions = module:shared"/*/c2s/sessions"; | 31 if prosody and prosody.arg then |
32 c2s_sessions, s2s_sessions = module:shared("/*/c2s/sessions", "/*/s2s/sessions"); | |
33 end | |
32 | 34 |
33 local stats = { | 35 local stats = { |
34 total_users = { | 36 total_users = { |
35 get = function () return it.count(it.keys(bare_sessions)); end | 37 get = function () return it.count(it.keys(bare_sessions)); end |
36 }; | 38 }; |