Merge pull request #153 from tiagoch/master

Show cumulative JSON reports for Lua CPU tests
This commit is contained in:
Alexey Kopytov
2017-06-29 12:14:25 +03:00
committed by GitHub
2 changed files with 71 additions and 15 deletions

View File

@ -7,18 +7,46 @@ sysbench.cmdline.options = {
-- the default values for built-in options are currently ignored, see
-- https://github.com/akopytov/sysbench/issues/151
["cpu-max-prime"] = {"CPU maximum prime", 10000},
["threads"] = {"Number of threads", 2},
["histogram"] = {"Show histogram", "on"},
["threads"] = {"Number of threads", 1},
["histogram"] = {"Show histogram", "off"},
["report-interval"] = {"Report interval", 1}
}
function event()
end
function sysbench.hooks.report_intermediate(stat)
function sysbench.hooks.report_cumulative(stat)
local seconds = stat.time_interval
print(string.format("%.0f;%u;%4.2f",
stat.time_total,
stat.threads_running,
stat.events / seconds))
end
print(string.format([[
{
"errors": %4.0f,
"events": %4.0f,
"latency_avg": %4.10f,
"latency_max": %4.10f,
"latency_min": %4.10f,
"latency_pct": %4.10f,
"latency_sum": %4.10f,
"other": %4.0f,
"reads": %4.0f,
"reconnects": %4.0f,
"threads_running": %4.0f,
"time_interval": %4.10f,
"time_total": %4.10f,
"writes": %4.0f
}
]],
stat.errors,
stat.events,
stat.latency_avg,
stat.latency_max,
stat.latency_min,
stat.latency_pct,
stat.latency_sum,
stat.other,
stat.reads,
stat.reconnects,
stat.threads_running,
stat.time_interval,
stat.time_total,
stat.writes))
end

View File

@ -7,8 +7,8 @@ sysbench.cmdline.options = {
-- the default values for built-in options are currently ignored, see
-- https://github.com/akopytov/sysbench/issues/151
["cpu-max-prime"] = {"CPU maximum prime", 10000},
["threads"] = {"Number of threads", 2},
["histogram"] = {"Show histogram", "on"},
["threads"] = {"Number of threads", 1},
["histogram"] = {"Show histogram", "off"},
["report-interval"] = {"Report interval", 1}
}
@ -29,10 +29,38 @@ function event()
end
end
function sysbench.hooks.report_intermediate(stat)
function sysbench.hooks.report_cumulative(stat)
local seconds = stat.time_interval
print(string.format("%.0f;%u;%4.2f",
stat.time_total,
stat.threads_running,
stat.events / seconds))
print(string.format([[
{
"errors": %4.0f,
"events": %4.0f,
"latency_avg": %4.10f,
"latency_max": %4.10f,
"latency_min": %4.10f,
"latency_pct": %4.10f,
"latency_sum": %4.10f,
"other": %4.0f,
"reads": %4.0f,
"reconnects": %4.0f,
"threads_running": %4.0f,
"time_interval": %4.10f,
"time_total": %4.10f,
"writes": %4.0f
}
]],
stat.errors,
stat.events,
stat.latency_avg,
stat.latency_max,
stat.latency_min,
stat.latency_pct,
stat.latency_sum,
stat.other,
stat.reads,
stat.reconnects,
stat.threads_running,
stat.time_interval,
stat.time_total,
stat.writes))
end