Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mrDoctorWho/vk4xmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrDoctorWho <mrdoctorwho@gmail.com>2014-05-06 10:04:57 +0400
committermrDoctorWho <mrdoctorwho@gmail.com>2014-05-06 10:04:57 +0400
commit309ac7b1614085b03e476ee353db432bae410ebc (patch)
tree8a5417776cb0ee067afcd2b4cbadc99b168447a1 /handlers
parentf9820a7dfeb91d18edc8dbb8ddabe689eb8b872f (diff)
New stats fields: msgin/msgout
Diffstat (limited to 'handlers')
-rw-r--r--handlers/IQ.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/handlers/IQ.py b/handlers/IQ.py
index 6ec2780..774b642 100644
--- a/handlers/IQ.py
+++ b/handlers/IQ.py
@@ -119,7 +119,7 @@ def iqRegisterHandler(cl, iq):
result = iqBuildError(iq, xmpp.ERR_BAD_REQUEST, _("Phone incorrect."))
if source in Transport:
user = Transport[source]
- deleteUser(user)
+ deleteUser(user, semph = False)
else:
user = User((phone, password), source)
if not usePassword:
@@ -148,7 +148,7 @@ def iqRegisterHandler(cl, iq):
logger.debug("user %s wants remove me..." % source)
if source in Transport:
user = Transport[source]
- deleteUser(user, True)
+ deleteUser(user, True, False)
result.setPayload([], add = 0)
watcherMsg(_("User removed registration: %s") % source)
else:
@@ -198,7 +198,9 @@ sDict = {
"memory/real": "KB",
"cpu/percent": "percent",
"cpu/time": "seconds",
- "thread/active": "threads"
+ "thread/active": "threads",
+ "msg/in": "messages",
+ "msg/out": "messages"
}
def iqStatsHandler(cl, iq):
@@ -218,7 +220,8 @@ def iqStatsHandler(cl, iq):
shell = os.popen("ps -o vsz,rss,%%cpu,time -p %s" % os.getpid()).readlines()
memVirt, memReal, cpuPercent, cpuTime = shell[1].split()
stats = {"users": users, "KB": [memVirt, memReal],
- "percent": [cpuPercent], "seconds": [cpuTime], "threads": [threading.activeCount()]}
+ "percent": [cpuPercent], "seconds": [cpuTime], "threads": [threading.activeCount()],
+ "messages": [Stats["msgout"], Stats["msgin"]]}
for Child in IQChildren:
if Child.getName() != "stat":
continue