Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
a9325d32
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看板
提交
a9325d32
编写于
7月 23, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cluster test clients
上级
06d5a144
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
15 deletion
+25
-15
tests/test/c/CMakeLists.txt
tests/test/c/CMakeLists.txt
+2
-2
tests/test/c/insertPerRow.c
tests/test/c/insertPerRow.c
+23
-13
未找到文件。
tests/test/c/CMakeLists.txt
浏览文件 @
a9325d32
...
...
@@ -10,8 +10,8 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
#add_executable(insertPerTable insertPerTable.c)
#target_link_libraries(insertPerTable taos_static pthread)
#
add_executable(insertPerRow insertPerRow.c)
#
target_link_libraries(insertPerRow taos_static pthread)
add_executable
(
insertPerRow insertPerRow.c
)
target_link_libraries
(
insertPerRow taos_static pthread
)
#add_executable(importOneRow importOneRow.c)
#target_link_libraries(importOneRow taos_static pthread)
...
...
tests/test/c/insertPerRow.c
浏览文件 @
a9325d32
...
...
@@ -44,14 +44,16 @@ void createDbAndTable();
void
insertData
();
int32_t
randomData
[
MAX_RANDOM_POINTS
];
int64_t
rowsPerTable
=
10000
;
int64_t
rowsPerTable
=
10000
00000
;
int64_t
pointsPerTable
=
1
;
int64_t
numOfThreads
=
1
;
int64_t
numOfTablesPerThread
=
2
00
;
int64_t
numOfThreads
=
1
0
;
int64_t
numOfTablesPerThread
=
1
00
;
char
dbName
[
32
]
=
"db"
;
char
stableName
[
64
]
=
"st"
;
int32_t
cache
=
16
;
int32_t
tables
=
5000
;
int32_t
cache
=
4
;
int32_t
replica
=
5000
;
int32_t
days
=
10
;
int32_t
interval
=
1000
;
int
main
(
int
argc
,
char
*
argv
[])
{
shellParseArgument
(
argc
,
argv
);
...
...
@@ -77,7 +79,7 @@ void createDbAndTable() {
exit
(
1
);
}
sprintf
(
qstr
,
"create database if not exists %s cache %d
maxtables %d"
,
dbName
,
cache
,
table
s
);
sprintf
(
qstr
,
"create database if not exists %s cache %d
replica %d days %d"
,
dbName
,
cache
,
replica
,
day
s
);
pSql
=
taos_query
(
con
,
qstr
);
int32_t
code
=
taos_errno
(
pSql
);
if
(
code
!=
0
)
{
...
...
@@ -239,7 +241,7 @@ void *syncTest(void *param) {
st
=
systemTime
.
tv_sec
*
1000000
+
systemTime
.
tv_usec
;
int64_t
start
=
1430000000000
;
int
64_t
int
erval
=
1000
;
// 1000 ms
interval
=
1000
;
// 1000 ms
char
*
sql
=
qstr
;
char
inserStr
[]
=
"insert into"
;
...
...
@@ -309,10 +311,14 @@ void printHelp() {
printf
(
"%s%s%s%"
PRId64
"
\n
"
,
indent
,
indent
,
"Number of threads to be used, default is "
,
numOfThreads
);
printf
(
"%s%s
\n
"
,
indent
,
"-n"
);
printf
(
"%s%s%s%"
PRId64
"
\n
"
,
indent
,
indent
,
"Number of tables per thread, default is "
,
numOfTablesPerThread
);
printf
(
"%s%s
\n
"
,
indent
,
"-
tables
"
);
printf
(
"%s%s%s%d
\n
"
,
indent
,
indent
,
"Database parameters
tables, default is "
,
tables
);
printf
(
"%s%s
\n
"
,
indent
,
"-
replica
"
);
printf
(
"%s%s%s%d
\n
"
,
indent
,
indent
,
"Database parameters
replica, default is "
,
replica
);
printf
(
"%s%s
\n
"
,
indent
,
"-cache"
);
printf
(
"%s%s%s%d
\n
"
,
indent
,
indent
,
"Database parameters cache, default is "
,
cache
);
printf
(
"%s%s%s%d
\n
"
,
indent
,
indent
,
"Database parameters replica, default is "
,
replica
);
printf
(
"%s%s
\n
"
,
indent
,
"-days"
);
printf
(
"%s%s%s%d
\n
"
,
indent
,
indent
,
"Database parameters days, default is "
,
days
);
printf
(
"%s%s
\n
"
,
indent
,
"-interval"
);
printf
(
"%s%s%s%d
\n
"
,
indent
,
indent
,
"Interval of each rows in ms, default is "
,
interval
);
exit
(
EXIT_SUCCESS
);
}
...
...
@@ -336,10 +342,14 @@ void shellParseArgument(int argc, char *argv[]) {
numOfThreads
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-n"
)
==
0
)
{
numOfTablesPerThread
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-
tables
"
)
==
0
)
{
tables
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-
replica
"
)
==
0
)
{
replica
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-cache"
)
==
0
)
{
cache
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-days"
)
==
0
)
{
days
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-interval"
)
==
0
)
{
interval
=
atoi
(
argv
[
++
i
]);
}
else
{
}
}
...
...
@@ -349,7 +359,7 @@ void shellParseArgument(int argc, char *argv[]) {
pPrint
(
"%snumOfThreads:%"
PRId64
"%s"
,
GREEN
,
numOfThreads
,
NC
);
pPrint
(
"%snumOfTablesPerThread:%"
PRId64
"%s"
,
GREEN
,
numOfTablesPerThread
,
NC
);
pPrint
(
"%scache:%"
PRId32
"%s"
,
GREEN
,
cache
,
NC
);
pPrint
(
"%stables:%"
PRId32
"%s"
,
GREEN
,
tables
,
NC
);
pPrint
(
"%stables:%"
PRId32
"%s"
,
GREEN
,
replica
,
NC
);
pPrint
(
"%sdbName:%s%s"
,
GREEN
,
dbName
,
NC
);
pPrint
(
"%stableName:%s%s"
,
GREEN
,
stableName
,
NC
);
pPrint
(
"%sstart to run%s"
,
GREEN
,
NC
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录