Software /
code /
prosody
Comparison
core/sessionmanager.lua @ 356:8ff322b550a3
Log number of open sessions on session creation
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 20 Nov 2008 01:32:24 +0000 |
parent | 339:c6446bbfe40c |
child | 357:17bcecb06420 |
comparison
equal
deleted
inserted
replaced
355:e25c8d91b37f | 356:8ff322b550a3 |
---|---|
28 if true then | 28 if true then |
29 session.trace = newproxy(true); | 29 session.trace = newproxy(true); |
30 getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; print("Session got collected, now "..open_sessions.." sessions are allocated") end; | 30 getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; print("Session got collected, now "..open_sessions.." sessions are allocated") end; |
31 end | 31 end |
32 open_sessions = open_sessions + 1; | 32 open_sessions = open_sessions + 1; |
33 log("info", "open sessions now: ".. open_sessions); | |
33 local w = conn.write; | 34 local w = conn.write; |
34 session.send = function (t) w(tostring(t)); end | 35 session.send = function (t) w(tostring(t)); end |
35 return session; | 36 return session; |
36 end | 37 end |
37 | 38 |