Merge pull request #563 from dingmingxin/master

add snax.profile_info interface
This commit is contained in:
云风
2016-12-16 10:35:01 +08:00
committed by GitHub
3 changed files with 8 additions and 1 deletions

View File

@@ -166,4 +166,9 @@ function snax.printf(fmt, ...)
skynet.error(string.format(fmt, ...))
end
function snax.profile_info(obj)
local t = snax.interface(obj.type)
return skynet_call(obj.handle, "snax", t.system.profile)
end
return snax

View File

@@ -35,7 +35,7 @@ return function (name , G, loader)
local env = setmetatable({} , { __index = temp_global })
local func = {}
local system = { "init", "exit", "hotfix" }
local system = { "init", "exit", "hotfix", "profile"}
do
for k, v in ipairs(system) do

View File

@@ -54,6 +54,8 @@ skynet.start(function()
if command == "hotfix" then
local hotfix = require "snax.hotfix"
skynet.ret(skynet.pack(hotfix(func, ...)))
elseif command == "profile" then
skynet.ret(skynet.pack(profile_table))
elseif command == "init" then
assert(not init, "Already init")
local initfunc = method[4] or function() end