Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_53320357
TDengine
提交
13b44b30
TDengine
项目概览
m0_53320357
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
13b44b30
编写于
4月 15, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add import test
上级
0765c20c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
13 deletion
+37
-13
tests/test/c/importOneRow.c
tests/test/c/importOneRow.c
+37
-13
未找到文件。
tests/test/c/importOneRow.c
浏览文件 @
13b44b30
...
...
@@ -20,6 +20,10 @@
#include "ttimer.h"
#include "tutil.h"
#define MAX_RANDOM_POINTS 20000
#define GREEN "\033[1;32m"
#define NC "\033[0m"
void
taos_error
(
TAOS
*
taos
);
void
*
taos_execute
(
void
*
param
);
...
...
@@ -32,22 +36,42 @@ int threadNum = 1;
int
rowNum
=
1000
;
int
replica
=
1
;
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
==
1
)
{
printf
(
"usage: %s rowNum threadNum replica configDir
\n
"
,
argv
[
0
]);
printf
(
"default rowNum %d
\n
"
,
rowNum
);
printf
(
"default threadNum %d
\n
"
,
threadNum
);
printf
(
"default replica %d
\n
"
,
replica
);
exit
(
0
);
void
printHelp
()
{
char
indent
[
10
]
=
" "
;
printf
(
"Used to test the performance of TDengine
\n
After writing one row of data to all tables, write the next row
\n
"
);
printf
(
"%s%s
\n
"
,
indent
,
"-r"
);
printf
(
"%s%s%s%d
\n
"
,
indent
,
indent
,
"Number of records to write table, default is "
,
rowNum
);
printf
(
"%s%s
\n
"
,
indent
,
"-t"
);
printf
(
"%s%s%s%d
\n
"
,
indent
,
indent
,
"Number of threads to be used, default is "
,
threadNum
);
printf
(
"%s%s
\n
"
,
indent
,
"-replica"
);
printf
(
"%s%s%s%d
\n
"
,
indent
,
indent
,
"Database parameters replica, default is "
,
replica
);
exit
(
EXIT_SUCCESS
);
}
void
shellParseArgument
(
int
argc
,
char
*
argv
[])
{
for
(
int
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
strcmp
(
argv
[
i
],
"-h"
)
==
0
||
strcmp
(
argv
[
i
],
"--help"
)
==
0
)
{
printHelp
();
exit
(
0
);
}
else
if
(
strcmp
(
argv
[
i
],
"-r"
)
==
0
)
{
rowNum
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-t"
)
==
0
)
{
threadNum
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-replica"
)
==
0
)
{
replica
=
atoi
(
argv
[
++
i
]);
}
else
{
}
}
// a simple way to parse input parameters
if
(
argc
>=
2
)
rowNum
=
atoi
(
argv
[
1
]);
if
(
argc
>=
3
)
threadNum
=
atoi
(
argv
[
2
]);
if
(
argc
>=
4
)
replica
=
atoi
(
argv
[
3
]);
if
(
argc
>=
5
)
strcpy
(
configDir
,
argv
[
4
]);
dPrint
(
"%s rowNum:%d %s"
,
GREEN
,
rowNum
,
NC
);
dPrint
(
"%s threadNum:%d %s"
,
GREEN
,
threadNum
,
NC
);
dPrint
(
"%s replica:%d %s"
,
GREEN
,
replica
,
NC
);
}
printf
(
"rowNum:%d threadNum:%d replica:%d
\n
"
,
threadNum
,
rowNum
,
replica
);
int
main
(
int
argc
,
char
*
argv
[])
{
shellParseArgument
(
argc
,
argv
);
taos_init
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录