mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
snlua stat
This commit is contained in:
@@ -383,6 +383,16 @@ function dbgcmd.GC()
|
||||
collectgarbage "collect"
|
||||
end
|
||||
|
||||
local function query_state(stat, what)
|
||||
stat[what] = c.stat(what)
|
||||
end
|
||||
|
||||
function dbgcmd.STAT()
|
||||
local stat = {}
|
||||
query_state(stat, "count")
|
||||
skynet.ret(skynet.pack(stat))
|
||||
end
|
||||
|
||||
local function _debug_dispatch(session, address, cmd, ...)
|
||||
local f = dbgcmd[cmd]
|
||||
assert(f, cmd)
|
||||
|
||||
Reference in New Issue
Block a user