-
Notifications
You must be signed in to change notification settings - Fork 9
Fix memtier: add a TAP-wrapper, bump memtier version, add to CI #84
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b0a8d21
memcached: fix typo
ligurio f548d4f
test: update deprecated options in box.cfg
ligurio 58874ce
readme: fix markdown markup
ligurio 7f293e2
third_party: bump memtier version
ligurio fab5e3b
test-run: bump version
ligurio 49a17e5
test: add a test with memtier benchmark
ligurio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule test-run
updated
29 files
+1 −0 | .gitignore | |
+110 −20 | README.md | |
+408 −0 | dispatcher.py | |
+66 −0 | lib/__init__.py | |
+2 −2 | lib/admin_connection.py | |
+106 −37 | lib/app_server.py | |
+55 −11 | lib/colorer.py | |
+4 −1 | lib/connpool.py | |
+46 −5 | lib/inspector.py | |
+210 −0 | lib/options.py | |
+0 −388 | lib/parallel.py | |
+110 −58 | lib/preprocessor.py | |
+213 −0 | lib/pytap13.py | |
+86 −16 | lib/server.py | |
+245 −0 | lib/server_mixins.py | |
+7 −0 | lib/singleton.py | |
+1 −1 | lib/tarantool-python | |
+19 −5 | lib/tarantool_connection.py | |
+374 −289 | lib/tarantool_server.py | |
+192 −64 | lib/test.py | |
+147 −93 | lib/test_suite.py | |
+28 −11 | lib/unittest_server.py | |
+149 −20 | lib/utils.py | |
+369 −0 | lib/worker.py | |
+237 −0 | listeners.py | |
+224 −0 | pretest_clean.lua | |
+1 −1 | requirements.txt | |
+182 −202 | test-run.py | |
+178 −69 | test_run.lua |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env tarantool | ||
|
||
box.cfg{ | ||
wal_mode = 'none', | ||
memtx_memory = 100 * 1024 * 1024, | ||
} | ||
|
||
require('console').listen(os.getenv('ADMIN')) | ||
|
||
box.schema.user.grant('guest', 'read,write,execute', 'universe') |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/usr/bin/env tarantool | ||
|
||
local tap = require('tap') | ||
local fio = require('fio') | ||
local has_popen, popen = pcall(require, 'popen') | ||
package.cpath = './?.so;' .. package.cpath | ||
local memcached = require('memcached') | ||
local test = tap.test('memcached benchmarks') | ||
|
||
if not has_popen then | ||
test:plan(0) | ||
os.exit(0) | ||
end | ||
|
||
test:plan(3) | ||
|
||
local is_test_run = os.getenv('LISTEN') | ||
|
||
if type(box.cfg) == 'function' then | ||
box.cfg{ | ||
wal_mode = 'none', | ||
memtx_memory = 100 * 1024 * 1024, | ||
} | ||
box.schema.user.grant('guest', 'read,write,execute', 'universe') | ||
end | ||
|
||
local port = 11211 | ||
local mc = memcached.create('memcached', tostring(port), {}) | ||
|
||
local function run_memtier(instance, memtier_path, proto) | ||
instance:cfg({ | ||
protocol = proto, | ||
}) | ||
local memtier_proto = 'memcache_' .. proto | ||
local memtier_argv = { | ||
memtier_path, | ||
'--server=127.0.0.1', | ||
string.format('--port=%d', port), | ||
string.format('--protocol=%s', memtier_proto), | ||
'--threads=10', | ||
'--test-time=2', | ||
'--hide-histogram' | ||
} | ||
|
||
local stdout = is_test_run and popen.opts.PIPE or popen.opts.INHERIT | ||
local stderr = is_test_run and popen.opts.PIPE or popen.opts.INHERIT | ||
local ph = popen.new(memtier_argv, { | ||
stdout = stdout, | ||
stderr = stderr, | ||
}) | ||
local res = ph:wait() | ||
ph:close() | ||
|
||
return res.exit_code | ||
end | ||
|
||
-- path to memtier_benchmark in case of tarantool that run in project root dir | ||
local memtier_path = 'test/bench/memtier_benchmark' | ||
if not fio.path.exists(memtier_path) then | ||
-- path to memtier_benchmark in case of test-run | ||
memtier_path = './memtier_benchmark' | ||
end | ||
|
||
test:is(fio.path.exists(memtier_path), true, 'memtier_benchmark binary is available') | ||
test:is(run_memtier(mc, memtier_path, 'text'), 0, 'memtier with text protocol') | ||
test:is(run_memtier(mc, memtier_path, 'binary'), 0, 'memtier with binary protocol') | ||
|
||
os.exit(0) | ||
ligurio marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[default] | ||
core = app | ||
description = memcached load tests with #! using TAP | ||
script = bench.lua | ||
is_parallel = False | ||
long_run = memtier.test.lua | ||
lua_libs = memtier_benchmark |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule memtier
updated
63 files
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.