Software / code / prosody
Comparison
plugins/mod_admin_telnet.lua @ 8128:c14513401d65
Merge 0.10->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 25 Apr 2017 01:42:59 +0200 |
| parent | 7982:e30b0cbed472 |
| parent | 8126:60f6f7ddd2ce |
| child | 8201:a0ad62a269df |
comparison
equal
deleted
inserted
replaced
| 8121:a33a87f13155 | 8128:c14513401d65 |
|---|---|
| 323 return ("%0.2f%sB"):format(kb, unit); | 323 return ("%0.2f%sB"):format(kb, unit); |
| 324 end | 324 end |
| 325 | 325 |
| 326 function def_env.server:memory() | 326 function def_env.server:memory() |
| 327 if not has_pposix or not pposix.meminfo then | 327 if not has_pposix or not pposix.meminfo then |
| 328 return true, "Lua is using "..collectgarbage("count"); | 328 return true, "Lua is using "..human(collectgarbage("count")); |
| 329 end | 329 end |
| 330 local mem, lua_mem = pposix.meminfo(), collectgarbage("count"); | 330 local mem, lua_mem = pposix.meminfo(), collectgarbage("count"); |
| 331 local print = self.session.print; | 331 local print = self.session.print; |
| 332 print("Process: "..human((mem.allocated+mem.allocated_mmap)/1024)); | 332 print("Process: "..human((mem.allocated+mem.allocated_mmap)/1024)); |
| 333 print(" Used: "..human(mem.used/1024).." ("..human(lua_mem).." by Lua)"); | 333 print(" Used: "..human(mem.used/1024).." ("..human(lua_mem).." by Lua)"); |