Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
c4e56b7b
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c4e56b7b
编写于
5月 23, 2020
作者:
S
Shuaiqiang Chang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: show paramters
上级
d03b77ef
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
9 deletion
+30
-9
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+30
-9
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
c4e56b7b
...
@@ -302,11 +302,11 @@ int main(int argc, char *argv[]) {
...
@@ -302,11 +302,11 @@ int main(int argc, char *argv[]) {
/* Parse our arguments; every option seen by parse_opt will be
/* Parse our arguments; every option seen by parse_opt will be
reflected in arguments. */
reflected in arguments. */
// For demo use, change default values for some parameters;
// For demo use, change default values for some parameters;
arguments
.
num_of_tables
=
10
000
;
arguments
.
num_of_tables
=
10
;
arguments
.
num_of_CPR
=
3
;
arguments
.
num_of_CPR
=
3
;
arguments
.
num_of_connections
=
10
;
arguments
.
num_of_connections
=
10
;
arguments
.
num_of_DPT
=
100
000
;
arguments
.
num_of_DPT
=
100
;
arguments
.
num_of_RPR
=
100
0
;
arguments
.
num_of_RPR
=
100
;
arguments
.
use_metric
=
true
;
arguments
.
use_metric
=
true
;
arguments
.
insert_only
=
true
;
arguments
.
insert_only
=
true
;
// end change
// end change
...
@@ -362,6 +362,26 @@ int main(int argc, char *argv[]) {
...
@@ -362,6 +362,26 @@ int main(int argc, char *argv[]) {
time_t
tTime
=
time
(
NULL
);
time_t
tTime
=
time
(
NULL
);
struct
tm
tm
=
*
localtime
(
&
tTime
);
struct
tm
tm
=
*
localtime
(
&
tTime
);
printf
(
"###################################################################
\n
"
);
printf
(
"# Server IP: %s:%hu
\n
"
,
ip_addr
==
NULL
?
"localhost"
:
ip_addr
,
port
);
printf
(
"# User: %s
\n
"
,
user
);
printf
(
"# Password: %s
\n
"
,
pass
);
printf
(
"# Use metric: %s
\n
"
,
use_metric
?
"true"
:
"false"
);
printf
(
"# Datatype of Columns: %s
\n
"
,
dataString
);
printf
(
"# Binary Length(If applicable): %d
\n
"
,
(
strcasestr
(
dataString
,
"BINARY"
)
!=
NULL
)
?
len_of_binary
:
-
1
);
printf
(
"# Number of Columns per record: %d
\n
"
,
ncols_per_record
);
printf
(
"# Number of Connections: %d
\n
"
,
nconnections
);
printf
(
"# Number of Tables: %d
\n
"
,
ntables
);
printf
(
"# Number of Data per Table: %d
\n
"
,
nrecords_per_table
);
printf
(
"# Records/Request: %d
\n
"
,
nrecords_per_request
);
printf
(
"# Database name: %s
\n
"
,
db_name
);
printf
(
"# Table prefix: %s
\n
"
,
tb_prefix
);
printf
(
"# Test time: %d-%02d-%02d %02d:%02d:%02d
\n
"
,
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
);
printf
(
"###################################################################
\n\n
"
);
printf
(
"Press enter key to continue"
);
getchar
();
fprintf
(
fp
,
"###################################################################
\n
"
);
fprintf
(
fp
,
"###################################################################
\n
"
);
fprintf
(
fp
,
"# Server IP: %s:%hu
\n
"
,
ip_addr
==
NULL
?
"localhost"
:
ip_addr
,
port
);
fprintf
(
fp
,
"# Server IP: %s:%hu
\n
"
,
ip_addr
==
NULL
?
"localhost"
:
ip_addr
,
port
);
...
@@ -858,15 +878,16 @@ void generateData(char *res, char **data_type, int num_of_cols, int64_t timestam
...
@@ -858,15 +878,16 @@ void generateData(char *res, char **data_type, int num_of_cols, int64_t timestam
pstr
+=
sprintf
(
pstr
,
")"
);
pstr
+=
sprintf
(
pstr
,
")"
);
}
}
static
const
char
charset
[]
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJK1234567890"
;
void
rand_string
(
char
*
str
,
int
size
)
{
void
rand_string
(
char
*
str
,
int
size
)
{
memset
(
str
,
0
,
size
);
str
[
0
]
=
0
;
const
char
charset
[]
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJK1234567890"
;
if
(
size
>
0
)
{
char
*
sptr
=
str
;
if
(
size
)
{
--
size
;
--
size
;
for
(
size_t
n
=
0
;
n
<
size
;
n
++
)
{
int
n
;
for
(
n
=
0
;
n
<
size
;
n
++
)
{
int
key
=
rand
()
%
(
int
)(
sizeof
charset
-
1
);
int
key
=
rand
()
%
(
int
)(
sizeof
charset
-
1
);
s
ptr
+=
sprintf
(
sptr
,
"%c"
,
charset
[
key
])
;
s
tr
[
n
]
=
charset
[
key
]
;
}
}
str
[
n
]
=
0
;
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录