Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
4a5e79ce
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
4a5e79ce
编写于
2月 28, 2020
作者:
A
alexey-milovidov
提交者:
GitHub
2月 28, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9416 from CurtizJ/benchmark-query-id
Allow to set query_id in clickhouse-benchmark
上级
6b2d6e93
a17d286e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
3 deletion
+19
-3
dbms/programs/benchmark/Benchmark.cpp
dbms/programs/benchmark/Benchmark.cpp
+8
-3
dbms/tests/queries/0_stateless/01088_benchmark_query_id.reference
...ts/queries/0_stateless/01088_benchmark_query_id.reference
+1
-0
dbms/tests/queries/0_stateless/01088_benchmark_query_id.sh
dbms/tests/queries/0_stateless/01088_benchmark_query_id.sh
+9
-0
dbms/tests/queries/shell_config.sh
dbms/tests/queries/shell_config.sh
+1
-0
未找到文件。
dbms/programs/benchmark/Benchmark.cpp
浏览文件 @
4a5e79ce
...
...
@@ -59,11 +59,11 @@ public:
bool
cumulative_
,
bool
secure_
,
const
String
&
default_database_
,
const
String
&
user_
,
const
String
&
password_
,
const
String
&
stage
,
bool
randomize_
,
size_t
max_iterations_
,
double
max_time_
,
const
String
&
json_path_
,
size_t
confidence_
,
const
Settings
&
settings_
)
const
String
&
json_path_
,
size_t
confidence_
,
const
S
tring
&
query_id_
,
const
S
ettings
&
settings_
)
:
concurrency
(
concurrency_
),
delay
(
delay_
),
queue
(
concurrency
),
randomize
(
randomize_
),
cumulative
(
cumulative_
),
max_iterations
(
max_iterations_
),
max_time
(
max_time_
),
confidence
(
confidence_
),
json_path
(
json_path
_
),
settings
(
settings_
),
json_path
(
json_path_
),
confidence
(
confidence_
),
query_id
(
query_id
_
),
settings
(
settings_
),
global_context
(
Context
::
createGlobal
()),
pool
(
concurrency
)
{
const
auto
secure
=
secure_
?
Protocol
::
Secure
::
Enable
:
Protocol
::
Secure
::
Disable
;
...
...
@@ -145,8 +145,9 @@ private:
bool
cumulative
;
size_t
max_iterations
;
double
max_time
;
size_t
confidence
;
String
json_path
;
size_t
confidence
;
std
::
string
query_id
;
Settings
settings
;
Context
global_context
;
QueryProcessingStage
::
Enum
query_processing_stage
;
...
...
@@ -367,6 +368,8 @@ private:
RemoteBlockInputStream
stream
(
*
(
*
connection_entries
[
connection_index
]),
query
,
{},
global_context
,
&
settings
,
nullptr
,
Scalars
(),
Tables
(),
query_processing_stage
);
if
(
!
query_id
.
empty
())
stream
.
setQueryId
(
query_id
);
Progress
progress
;
stream
.
setProgressCallback
([
&
progress
](
const
Progress
&
value
)
{
progress
.
incrementPiecewiseAtomically
(
value
);
});
...
...
@@ -535,6 +538,7 @@ int mainEntryClickHouseBenchmark(int argc, char ** argv)
(
"database"
,
value
<
std
::
string
>
()
->
default_value
(
"default"
),
""
)
(
"stacktrace"
,
"print stack traces of exceptions"
)
(
"confidence"
,
value
<
size_t
>
()
->
default_value
(
5
),
"set the level of confidence for T-test [0=80%, 1=90%, 2=95%, 3=98%, 4=99%, 5=99.5%(default)"
)
(
"query_id"
,
value
<
std
::
string
>
()
->
default_value
(
""
),
""
)
;
Settings
settings
;
...
...
@@ -573,6 +577,7 @@ int mainEntryClickHouseBenchmark(int argc, char ** argv)
options
[
"timelimit"
].
as
<
double
>
(),
options
[
"json"
].
as
<
std
::
string
>
(),
options
[
"confidence"
].
as
<
size_t
>
(),
options
[
"query_id"
].
as
<
std
::
string
>
(),
settings
);
return
benchmark
.
run
();
}
...
...
dbms/tests/queries/0_stateless/01088_benchmark_query_id.reference
0 → 100644
浏览文件 @
4a5e79ce
20
dbms/tests/queries/0_stateless/01088_benchmark_query_id.sh
0 → 100755
浏览文件 @
4a5e79ce
#!/usr/bin/env bash
CURDIR
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
.
$CURDIR
/../shell_config.sh
QUERY_ID
=
$RANDOM
$CLICKHOUSE_BENCHMARK
<<<
"SELECT 1"
--query_id
$QUERY_ID
-i
10 2>/dev/null
$CLICKHOUSE_CLIENT
-q
"SYSTEM FLUSH LOGS"
$CLICKHOUSE_CLIENT
-q
"SELECT count() FROM system.query_log WHERE query_id='
$QUERY_ID
'"
dbms/tests/queries/shell_config.sh
浏览文件 @
4a5e79ce
...
...
@@ -15,6 +15,7 @@ export CLICKHOUSE_CLIENT=${CLICKHOUSE_CLIENT:="$CLICKHOUSE_CLIENT_BINARY ${CLICK
[
-x
"
${
CLICKHOUSE_BINARY
}
"
]
&&
CLICKHOUSE_LOCAL
=
${
CLICKHOUSE_LOCAL
:
=
"
${
CLICKHOUSE_BINARY
}
local"
}
export
CLICKHOUSE_LOCAL
=
${
CLICKHOUSE_LOCAL
:
=
"
${
CLICKHOUSE_BINARY
}
-local"
}
export
CLICKHOUSE_OBFUSCATOR
=
${
CLICKHOUSE_OBFUSCATOR
:
=
"
${
CLICKHOUSE_BINARY
}
-obfuscator"
}
export
CLICKHOUSE_BENCHMARK
=
${
CLICKHOUSE_BENCHMARK
:
=
"
${
CLICKHOUSE_BINARY
}
-benchmark"
}
export
CLICKHOUSE_CONFIG
=
${
CLICKHOUSE_CONFIG
:
=
"/etc/clickhouse-server/config.xml"
}
export
CLICKHOUSE_CONFIG_CLIENT
=
${
CLICKHOUSE_CONFIG_CLIENT
:
=
"/etc/clickhouse-client/config.xml"
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录