mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
Merge pull request #563 from dingmingxin/master
add snax.profile_info interface
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user