Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add snax.profile_info interface #563

Merged
merged 1 commit into from
Dec 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lualib/snax.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lualib/snax/interface.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions service/snaxd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down