dbms: clickhouse-benchmark: more handy [#METR-19577].

This commit is contained in:
Alexey Milovidov 2015-12-26 06:42:16 +03:00
parent 08dc786e84
commit 45d13d0426

View File

@ -150,6 +150,15 @@ private:
}
void printNumberOfQueriesExecuted(size_t num)
{
std::cerr << "\nQueries executed: " << num;
if (queries.size() > 1)
std::cerr << " (" << (num * 100.0 / queries.size()) << "%)";
std::cerr << ".\n";
}
void run()
{
for (size_t i = 0; i < concurrency; ++i)
@ -170,6 +179,13 @@ private:
if (watch.elapsedSeconds() > delay)
{
auto total_queries = 0;
{
Poco::ScopedLock<Poco::FastMutex> lock(mutex);
total_queries = info_total.queries;
}
printNumberOfQueriesExecuted(total_queries);
report(info_per_interval);
watch.restart();
}
@ -181,7 +197,7 @@ private:
pool.wait();
std::cerr << "\nTotal queries executed: " << info_total.queries << "\n";
printNumberOfQueriesExecuted(info_total.queries);
report(info_total);
}