mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Add a test for memory tracking via HTTP interface
This commit is contained in:
parent
844960195d
commit
bffd4cf576
@ -0,0 +1 @@
|
||||
10000
|
26
tests/queries/0_stateless/01238_http_memory_tracking.sh
Executable file
26
tests/queries/0_stateless/01238_http_memory_tracking.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. $CURDIR/../shell_config.sh
|
||||
|
||||
# TODO: the test can be way more optimal
|
||||
|
||||
set -o pipefail
|
||||
|
||||
function execute_null()
|
||||
{
|
||||
${CLICKHOUSE_CLIENT} --format Null -n "$@"
|
||||
}
|
||||
|
||||
# This is needed to keep at least one running query for user for the time of test.
|
||||
# (10k http queries takes 10seconds, let's run for 3x more to avoid flaps)
|
||||
execute_null <<<'SELECT sleepEachRow(1) FROM numbers(30)' &
|
||||
|
||||
# ignore "yes: standard output: Broken pipe"
|
||||
yes 'SELECT 1' 2>/dev/null | {
|
||||
head -n10000
|
||||
} | {
|
||||
xargs -P10000 -i ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}&wait_end_of_query=1&max_memory_usage_for_user=$((10<<30))" -d '{}'
|
||||
} | grep -x -c 1
|
||||
|
||||
wait
|
Loading…
Reference in New Issue
Block a user