timing remote call

This commit is contained in:
云风
2014-02-23 17:13:58 +08:00
parent 5944668796
commit c1e6737711
7 changed files with 331 additions and 5 deletions

View File

@@ -48,6 +48,22 @@ function command.INFO(handle)
end
end
function command.TIMING(handle)
handle = handle_to_address(handle)
if services[handle] == nil then
skynet.ret(skynet.pack(nil))
else
local r = skynet.call(handle,"debug","TIMING")
local result = {}
for k,v in pairs(r) do
local key = services[k] or string.format("[:%08x]", k)
v.avg = v.ti/v.n
result[key] = v
end
skynet.ret(skynet.pack(result))
end
end
function command.KILL(handle)
handle = handle_to_address(handle)
skynet.kill(handle)