mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
get snax profile_table after rewriting info_func of snax service
This commit is contained in:
@@ -166,4 +166,9 @@ function snax.printf(fmt, ...)
|
|||||||
skynet.error(string.format(fmt, ...))
|
skynet.error(string.format(fmt, ...))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function snax.profile_info(obj)
|
||||||
|
local t = snax.interface(obj.type)
|
||||||
|
return skynet_call(obj.handle, "snax", t.system.profile)
|
||||||
|
end
|
||||||
|
|
||||||
return snax
|
return snax
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ return function (name , G, loader)
|
|||||||
local env = setmetatable({} , { __index = temp_global })
|
local env = setmetatable({} , { __index = temp_global })
|
||||||
local func = {}
|
local func = {}
|
||||||
|
|
||||||
local system = { "init", "exit", "hotfix" }
|
local system = { "init", "exit", "hotfix", "profile"}
|
||||||
|
|
||||||
do
|
do
|
||||||
for k, v in ipairs(system) do
|
for k, v in ipairs(system) do
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ skynet.start(function()
|
|||||||
if command == "hotfix" then
|
if command == "hotfix" then
|
||||||
local hotfix = require "snax.hotfix"
|
local hotfix = require "snax.hotfix"
|
||||||
skynet.ret(skynet.pack(hotfix(func, ...)))
|
skynet.ret(skynet.pack(hotfix(func, ...)))
|
||||||
|
elseif command == "profile" then
|
||||||
|
skynet.ret(skynet.pack(profile_table))
|
||||||
elseif command == "init" then
|
elseif command == "init" then
|
||||||
assert(not init, "Already init")
|
assert(not init, "Already init")
|
||||||
local initfunc = method[4] or function() end
|
local initfunc = method[4] or function() end
|
||||||
|
|||||||
Reference in New Issue
Block a user