Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r 3e4ce5ec50fd lua/userver/controller.lua
- --- a/lua/userver/controller.lua Tue Jun 13 11:23:19 2017 +0300
- +++ b/lua/userver/controller.lua Thu Jun 22 20:27:57 2017 +0300
- @@ -710,7 +710,14 @@
- local action = get_param('action')
- if action == 'start' then
- local file_name
- - if get_param('leaf') == '1' then
- + local PROFILER_MODES = {
- + ["default"] = "default",
- + ["leaf"] = "leaf",
- + ["callgraph"] = "callgraph",
- + }
- + local mode = PROFILER_MODES[get_param('mode')] or error ("Wrong profiler mode");
- +
- + if not (mode == 'default') then
- file_name = userver.table.pindex(
- server_conf, 'lua', 'jit', 'profile', 'file_name')
- if not file_name then
- @@ -719,7 +726,7 @@
- end
- local interval = tonumber(get_param('interval')) or 100 -- microseconds
- - local started = debug.profile.start(interval, file_name)
- + local started = debug.profile.start(interval, mode, file_name)
- response.content = started and 'OK' or 'Already started'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement