-
Notifications
You must be signed in to change notification settings - Fork 3
tests/lapi: add sysprof test #151
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
base: master
Are you sure you want to change the base?
Conversation
586ceda
to
421cf11
Compare
421cf11
to
4172439
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Sergey!
Thanks for the patch-set.
I'll proceed with the review per-patch below.
[PATCH 1/2] tests/lapi: add sysprof test
I would rather split this patch into 2 separate ones -- for jit.p
and misc.sysprof
correspondingly.
tests/lapi/misc_sysprof_test.lua
Outdated
local MAX_INT = test_lib.MAX_INT | ||
local MIN_INT = test_lib.MIN_INT | ||
|
||
local has_tnt_sysprof, sysprof = pcall(require, "misc.sysprof") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather separate those profilers to make test a little bit clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
splited to two tests:
tests/lapi/jit_p_test.lua
tests/lapi/misc_sysprof_test.lua
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can move misc_sysprof_test.lua
to tarantool repo if you wish. Because it is not applicable to other Lua runtimes and Tarantool-specific.
.luacheckrc
Outdated
@@ -1,3 +1,6 @@ | |||
-- Tarantool introduces a global for misc API namespace. | |||
read_globals = { "misc" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary, since you may refer the sysprof's functions via require
result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
tests/lapi/misc_sysprof_test.lua
Outdated
"i", -- Sampling interval in milliseconds (default 10ms). | ||
} | ||
|
||
local SYSPROF_DEFAULT_INTERVAL = 10 -- ms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to use the minimum possible interval here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to 1
tests/lapi/misc_sysprof_test.lua
Outdated
mode = mode, | ||
path = "/dev/null", | ||
}) | ||
assert(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: It may be written as the following:
assert(misc.sysprof.start(...))
Feel free to ignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrapped with assert()
, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[PATCH 2/2] tests/capi: omit sysprof testing
With test misc_sysprof_test.lua
added in the previous commit sysprof in luaL_loadbuffer_proto_test
is not needed anymore.
I do not agree with this:
- It handles the different API invocations (not the C callback, but the Lua function).
- The test added in the previous commit is not very useful unless the Lua mutator is added.
Thus, I suggest dropping this commit for now.
removed from the patchset (cherry-picked to the branch with |
The patch adds tests for sysprof built into LuaJIT and Tarantool's sysprof.
4172439
to
08f5667
Compare
No description provided.