* [Tarantool-patches] [PATCH] error: remove failing code from microb integration
@ 2020-12-08 11:08 Oleg Koshovetc
2020-12-08 11:16 ` Oleg Koshovetc
0 siblings, 1 reply; 2+ messages in thread
From: Oleg Koshovetc @ 2020-12-08 11:08 UTC (permalink / raw)
To: Alexander Tikhonov, Alexander Turenko; +Cc: tarantool-patches
In commit 51836e1fa6d5e040306bbe67ca28525450c8a863 the code responsible
for microb integration was removed, but not completely. This remainings
caused benchmark to exit with non-zero exit code, which is not good for
automation. The other unused code was also removed. I also added
.luacheckrc config that could have spotted the error before.
---
.luacheckrc | 17 +++++++++++++++++
cbench_runner.lua | 30 +++++++++++-------------------
2 files changed, 28 insertions(+), 19 deletions(-)
create mode 100644 .luacheckrc
diff --git a/.luacheckrc b/.luacheckrc
new file mode 100644
index 0000000..dd43353
--- /dev/null
+++ b/.luacheckrc
@@ -0,0 +1,17 @@
+redefined = false
+
+exclude_files = {
+ '.rocks',
+}
+
+globals = {
+ 'box'
+}
+
+ignore = {
+ '212', -- unused argument
+ '213', -- unused loop variable
+ '542', -- empty if branch
+}
+
+-- vim:syntax=lua:sw=4:ts=4:expandtab
diff --git a/cbench_runner.lua b/cbench_runner.lua
index ecf50b1..79ae794 100755
--- a/cbench_runner.lua
+++ b/cbench_runner.lua
@@ -1,7 +1,5 @@
--- init tarantool db wor tests
-
-
if #arg < 1 then
print('Please specify engine [memtx] or [vinyl]')
os.exit(1)
@@ -9,6 +7,9 @@ end
local engine = arg[1]
+local wal_mode
+local count
+
if engine == 'vinyl' then
if #arg < 2 then
print('Please specify wal_mode [write] or [fsync]')
@@ -40,20 +41,7 @@ end
local version = box.info.version
-function split(str, delim)
- if string.find(str, delim) == nil then
- return { str }
- end
- local result, pat, lastpos = {}, "(.-)" .. delim .. "()", nil
- for part, pos in string.gfind(str, pat) do
- table.insert(result, part)
- lastpos = pos
- end
- table.insert(result, string.sub(str, lastpos))
- return result
-end
-
-function urlencode(t)
+local function urlencode(t)
local result = '?'
for key, val in pairs(t) do
if result ~= '?' then
@@ -66,6 +54,7 @@ end
-- Workloads
local tests = { 'replaces', 'selects', 'selrepl', 'updates', 'deletes' }
+local workloads
if engine == 'vinyl' then
workloads = {
{ tests = tests, type = 'tree', parts = { 'num' } },
@@ -93,17 +82,17 @@ if engine == 'memtx' then
}
end
-function export(name, bench_key, value)
+local function export(name, bench_key, value)
local chart_name = name:gsub(' ', '_'):gsub('+_', ''):lower()
local result = {
- key = token, name = 'cb.' .. bench_key .. '.' .. chart_name,
+ name = 'cb.' .. bench_key .. '.' .. chart_name,
param = tostring(math.floor(value)), unit = 'rps',
tab = 'cbench.' .. chart_name, v = version
}
print(urlencode(result))
end
-function run()
+local function run()
local benches = bench.run(workloads, count, iterations, engine)
for _, data in pairs(benches) do
local name = data[1]
@@ -113,5 +102,8 @@ function run()
end
end
end
+
run()
os.exit()
+
+-- vim:ts=4:sw=4:expandtab
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Tarantool-patches] [PATCH] error: remove failing code from microb integration
2020-12-08 11:08 [Tarantool-patches] [PATCH] error: remove failing code from microb integration Oleg Koshovetc
@ 2020-12-08 11:16 ` Oleg Koshovetc
0 siblings, 0 replies; 2+ messages in thread
From: Oleg Koshovetc @ 2020-12-08 11:16 UTC (permalink / raw)
To: Alexander Tikhonov, Alexander Turenko; +Cc: tarantool-patches
Sorry for the follow-up, I forgot to add github PR link if that's more
comforting for you to look at a patch
https://github.com/tarantool/cbench/pull/6
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-08 11:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 11:08 [Tarantool-patches] [PATCH] error: remove failing code from microb integration Oleg Koshovetc
2020-12-08 11:16 ` Oleg Koshovetc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox