add skynet.stat() to get cpu cost and message count

This commit is contained in:
Cloud Wu
2016-10-26 17:43:52 +08:00
parent 07a1499886
commit 249ffb9362
10 changed files with 104 additions and 27 deletions

View File

@@ -634,11 +634,15 @@ function skynet.start(start_func)
end
function skynet.endless()
return c.command("ENDLESS")~=nil
return (c.intcommand("STAT", "endless") == 1)
end
function skynet.mqlen()
return c.intcommand "MQLEN"
return c.intcommand("STAT", "mqlen")
end
function skynet.stat(what)
return c.intcommand("STAT", what)
end
function skynet.task(ret)