# HG changeset patch # User Matthew Wild # Date 1371330455 -3600 # Node ID 3e2c4f4247973c303b184aa83d24f1b7cb8417c6 # Parent 3af947e2e6d45842bc424e0e97ff397d888b5a3c mod_statistics: Remove expensive and non-portable /proc-based memory stats diff -r 3af947e2e6d4 -r 3e2c4f424797 mod_statistics/stats.lib.lua --- a/mod_statistics/stats.lib.lua Sat Jun 15 21:17:09 2013 +0100 +++ b/mod_statistics/stats.lib.lua Sat Jun 15 22:07:35 2013 +0100 @@ -108,35 +108,6 @@ } end -local pagesize = 4096; -stats.memory_total = { - get = function () - local statm, err = io.open"/proc/self/statm"; - if statm then - local total = statm:read"*n"; - statm:close(); - return total * pagesize; - else - module:log("debug", err); - end - end; - tostring = human; -}; -stats.memory_rss = { - get = function () - local statm, err = io.open"/proc/self/statm"; - if statm then - statm:read"*n"; -- Total size, ignore - local rss = statm:read"*n"; - statm:close(); - return rss * pagesize; - else - module:log("debug", err); - end - end; - tostring = human; -}; - local add_statistics_filter; -- forward decl if prosody and prosody.arg then -- ensures we aren't in prosodyctl setmetatable(active_sessions, {