Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
7103157b
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,体验更适合开发者的 AI 搜索 >>
提交
7103157b
编写于
9月 26, 2016
作者:
V
Vitaliy Lyudvichenko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added simple test for groupUniqArray(String). [#METR-22071]
Also reverted Benchmark.cpp it will be added in separate PR.
上级
80f037b1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
24 deletion
+25
-24
dbms/src/Client/Benchmark.cpp
dbms/src/Client/Benchmark.cpp
+5
-24
dbms/tests/queries/0_stateless/00373_group_uniq_array_simple.reference
...eries/0_stateless/00373_group_uniq_array_simple.reference
+10
-0
dbms/tests/queries/0_stateless/00373_group_uniq_array_simple.sql
...sts/queries/0_stateless/00373_group_uniq_array_simple.sql
+10
-0
未找到文件。
dbms/src/Client/Benchmark.cpp
浏览文件 @
7103157b
...
...
@@ -8,7 +8,6 @@
#include <fstream>
#include <iomanip>
#include <random>
#include <limits.h>
#include <Poco/File.h>
#include <Poco/Util/Application.h>
...
...
@@ -59,11 +58,11 @@ public:
Benchmark
(
unsigned
concurrency_
,
double
delay_
,
const
String
&
host_
,
UInt16
port_
,
const
String
&
default_database_
,
const
String
&
user_
,
const
String
&
password_
,
const
String
&
stage
,
bool
randomize_
,
size_t
num_repetions_
,
double
max_time_
,
bool
randomize_
,
const
Settings
&
settings_
)
:
concurrency
(
concurrency_
),
delay
(
delay_
),
queue
(
concurrency
),
connections
(
concurrency
,
host_
,
port_
,
default_database_
,
user_
,
password_
),
randomize
(
randomize_
),
num_repetions
(
num_repetions_
),
max_time
(
max_time_
),
randomize
(
randomize_
),
settings
(
settings_
),
pool
(
concurrency
)
{
std
::
cerr
<<
std
::
fixed
<<
std
::
setprecision
(
3
);
...
...
@@ -95,8 +94,6 @@ private:
ConnectionPool
connections
;
bool
randomize
;
size_t
num_repetions
;
double
max_time
;
Settings
settings
;
QueryProcessingStage
::
Enum
query_processing_stage
;
...
...
@@ -186,7 +183,7 @@ private:
Stopwatch
watch
;
/// В цикле, кладём все запросы в очередь.
for
(
size_t
i
=
0
;
!
interrupt_listener
.
check
()
&&
(
!
(
num_repetions
>
0
)
||
i
<
num_repetions
)
;
++
i
)
for
(
size_t
i
=
0
;
!
interrupt_listener
.
check
();
++
i
)
{
if
(
i
>=
queries
.
size
())
i
=
0
;
...
...
@@ -197,7 +194,7 @@ private:
queue
.
push
(
queries
[
query_index
]);
if
(
delay
>
0
&&
watch
.
elapsedSeconds
()
>
delay
)
if
(
watch
.
elapsedSeconds
()
>
delay
)
{
auto
total_queries
=
0
;
{
...
...
@@ -209,18 +206,6 @@ private:
report
(
info_per_interval
);
watch
.
restart
();
}
if
(
num_repetions
>
0
&&
info_total
.
queries
>=
num_repetions
)
{
std
::
cout
<<
"The execution is broken since request number of loops is reached
\n
"
;
break
;
}
if
(
max_time
>
0
&&
info_total
.
watch
.
elapsedSeconds
()
>=
max_time
)
{
std
::
cout
<<
"The execution is broken since requested time limit is reached
\n
"
;
break
;
}
}
/// Попросим потоки завершиться.
...
...
@@ -361,15 +346,13 @@ int main(int argc, char ** argv)
desc
.
add_options
()
(
"help"
,
"produce help message"
)
(
"concurrency,c"
,
boost
::
program_options
::
value
<
unsigned
>
()
->
default_value
(
1
),
"number of parallel queries"
)
(
"delay,d"
,
boost
::
program_options
::
value
<
double
>
()
->
default_value
(
1
),
"delay between reports in seconds
(set 0 to disable)
"
)
(
"delay,d"
,
boost
::
program_options
::
value
<
double
>
()
->
default_value
(
1
),
"delay between reports in seconds"
)
(
"host,h"
,
boost
::
program_options
::
value
<
std
::
string
>
()
->
default_value
(
"localhost"
),
""
)
(
"port"
,
boost
::
program_options
::
value
<
UInt16
>
()
->
default_value
(
9000
),
""
)
(
"user"
,
boost
::
program_options
::
value
<
std
::
string
>
()
->
default_value
(
"default"
),
""
)
(
"password"
,
boost
::
program_options
::
value
<
std
::
string
>
()
->
default_value
(
""
),
""
)
(
"database"
,
boost
::
program_options
::
value
<
std
::
string
>
()
->
default_value
(
"default"
),
""
)
(
"stage"
,
boost
::
program_options
::
value
<
std
::
string
>
()
->
default_value
(
"complete"
),
"request query processing up to specified stage"
)
(
"loops,l"
,
boost
::
program_options
::
value
<
size_t
>
()
->
default_value
(
0
),
"number of tests repetions"
)
(
"timelimit,t"
,
boost
::
program_options
::
value
<
double
>
()
->
default_value
(
0.
),
"stop repeating after specified time limit"
)
(
"randomize,r"
,
boost
::
program_options
::
value
<
bool
>
()
->
default_value
(
false
),
"randomize order of execution"
)
#define DECLARE_SETTING(TYPE, NAME, DEFAULT) (#NAME, boost::program_options::value<std::string> (), "Settings.h")
#define DECLARE_LIMIT(TYPE, NAME, DEFAULT) (#NAME, boost::program_options::value<std::string> (), "Limits.h")
...
...
@@ -409,8 +392,6 @@ int main(int argc, char ** argv)
options
[
"password"
].
as
<
std
::
string
>
(),
options
[
"stage"
].
as
<
std
::
string
>
(),
options
[
"randomize"
].
as
<
bool
>
(),
options
[
"loops"
].
as
<
size_t
>
(),
options
[
"timelimit"
].
as
<
double
>
(),
settings
);
}
catch
(
const
Exception
&
e
)
...
...
dbms/tests/queries/0_stateless/00373_group_uniq_array_simple.reference
0 → 100644
浏览文件 @
7103157b
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
dbms/tests/queries/0_stateless/00373_group_uniq_array_simple.sql
0 → 100644
浏览文件 @
7103157b
DROP
TABLE
IF
EXISTS
test
.
group_uniq
;
CREATE
TABLE
test
.
group_uniq
ENGINE
=
Memory
AS
SELECT
number
%
10
as
id
,
toString
(
intDiv
((
number
%
10000
),
10
))
as
v
FROM
system
.
numbers
LIMIT
10000000
;
INSERT
INTO
test
.
group_uniq
SELECT
2
as
id
,
toString
(
number
%
100
)
as
v
FROM
system
.
numbers
LIMIT
1000000
;
INSERT
INTO
test
.
group_uniq
SELECT
5
as
id
,
toString
(
number
%
100
)
as
v
FROM
system
.
numbers
LIMIT
10000000
;
SELECT
length
(
groupUniqArray
(
v
))
FROM
test
.
group_uniq
GROUP
BY
id
ORDER
BY
id
;
--SELECT length(groupUniqArray(v)) FROM remote('127.0.0.{1,2,3,4}', 'test', 'group_uniq') GROUP BY id ORDER BY id;
DROP
TABLE
IF
EXISTS
test
.
group_uniq
;
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录