mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 16:50:48 +00:00
Cleanup.
This commit is contained in:
parent
b928d87d8a
commit
78df28f0e9
@ -305,10 +305,9 @@ void PerformanceTest::runQueries(
|
|||||||
|
|
||||||
// Pull memory usage data from query log. The log entries take some time
|
// Pull memory usage data from query log. The log entries take some time
|
||||||
// to become available, so we do this after running all the queries, and
|
// to become available, so we do this after running all the queries, and
|
||||||
// might still have to wait. We will wait in increment of 0.5s, for no more
|
// might still have to wait.
|
||||||
// than than 10s in total.
|
|
||||||
const int one_wait_us = 500 * 1000;
|
const int one_wait_us = 500 * 1000;
|
||||||
const int max_waits = (10 * 1000 * 1000) / one_wait_us;
|
const int max_waits = (30 * 1000 * 1000) / one_wait_us;
|
||||||
int n_waits = 0;
|
int n_waits = 0;
|
||||||
for (auto & statistics : statistics_by_run)
|
for (auto & statistics : statistics_by_run)
|
||||||
{
|
{
|
||||||
@ -339,12 +338,9 @@ retry:
|
|||||||
assert(ref.size == sizeof(UInt64));
|
assert(ref.size == sizeof(UInt64));
|
||||||
statistics.memory_usage = *reinterpret_cast<const UInt64*>(ref.data);
|
statistics.memory_usage = *reinterpret_cast<const UInt64*>(ref.data);
|
||||||
log_reader.readSuffix();
|
log_reader.readSuffix();
|
||||||
|
|
||||||
fprintf(stderr, "Memory usage for query '%s' is %ld\n",
|
|
||||||
statistics.query_id.c_str(), statistics.memory_usage);
|
|
||||||
}
|
}
|
||||||
fprintf(stderr, "Waited for query log for %.2fs\n",
|
|
||||||
(n_waits * one_wait_us) / 1e6f);
|
printf("Waited for query log for %.2fs\n", (n_waits * one_wait_us) / 1e6f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,7 +59,6 @@ void executeQuery(
|
|||||||
statistics.last_query_bytes_read = 0;
|
statistics.last_query_bytes_read = 0;
|
||||||
statistics.query_id = query_id_prefix + std::to_string(next_query_id++);
|
statistics.query_id = query_id_prefix + std::to_string(next_query_id++);
|
||||||
|
|
||||||
fprintf(stderr, "Query id is '%s'\n", statistics.query_id.c_str());
|
|
||||||
RemoteBlockInputStream stream(connection, query, {}, context, &settings);
|
RemoteBlockInputStream stream(connection, query, {}, context, &settings);
|
||||||
stream.setQueryId(statistics.query_id);
|
stream.setQueryId(statistics.query_id);
|
||||||
|
|
||||||
|
@ -49,15 +49,6 @@ public:
|
|||||||
/// Set the query_id. For now, used by performance test to later find the query
|
/// Set the query_id. For now, used by performance test to later find the query
|
||||||
/// in the server query_log. Must be called before sending the query to the
|
/// in the server query_log. Must be called before sending the query to the
|
||||||
/// server.
|
/// server.
|
||||||
///
|
|
||||||
/// FIXME This should have been a parameter of the constructor, but I can't bring
|
|
||||||
/// myself to add even more parameters. These constructors actually implement
|
|
||||||
/// (in a quite bizarre way) an overloaded function that prepares the multiplexed
|
|
||||||
/// connection wrapper. It should have been a plain function that is run by
|
|
||||||
/// the caller, but apparently that would have been obscenely straighforward,
|
|
||||||
/// too easy to understand and not insane at all, which is a blatant violation
|
|
||||||
/// of our coding conventions.
|
|
||||||
/// I'm not going to rewrite it now, so that I can get at least something done.
|
|
||||||
void setQueryId(std::string _query_id) { assert(!sent_query); query_id = _query_id; }
|
void setQueryId(std::string _query_id) { assert(!sent_query); query_id = _query_id; }
|
||||||
|
|
||||||
/// Specify how we allocate connections on a shard.
|
/// Specify how we allocate connections on a shard.
|
||||||
|
Loading…
Reference in New Issue
Block a user