mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
e9baaa439b
* New metrics provider (Procfs) + Refactored TasksStatsCounters * Trivial statless test that ProcFS is provided * Trivial perf test for ProcfsMetricsProvider Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>
42 lines
992 B
Bash
Executable File
42 lines
992 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Sandbox does not provide CAP_NET_ADMIN capability but does have ProcFS mounted at /proc
|
|
# This ensures that OS metrics can be collected
|
|
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
. $CURDIR/../shell_config.sh
|
|
|
|
function read_numbers_func()
|
|
{
|
|
$CLICKHOUSE_CLIENT -q "
|
|
SELECT * FROM numbers(600000000) FORMAT Null SETTINGS max_threads = 1
|
|
";
|
|
}
|
|
|
|
|
|
function show_processes_func()
|
|
{
|
|
sleep 0.1;
|
|
|
|
# These two system metrics for the generating query above are guaranteed to be nonzero when ProcFS is mounted at /proc
|
|
$CLICKHOUSE_CLIENT -q "
|
|
SELECT count() > 0 FROM system.processes\
|
|
WHERE has(ProfileEvents.Names, 'OSCPUVirtualTimeMicroseconds') AND has(ProfileEvents.Names, 'OSReadChars')\
|
|
SETTINGS max_threads = 1
|
|
";
|
|
}
|
|
|
|
|
|
export -f read_numbers_func;
|
|
export -f show_processes_func;
|
|
|
|
TIMEOUT=3
|
|
|
|
timeout $TIMEOUT bash -c read_numbers_func &
|
|
timeout $TIMEOUT bash -c show_processes_func &
|
|
|
|
wait
|
|
|
|
echo "Test OK"
|