Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2dd89ced
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
2dd89ced
编写于
3月 12, 2021
作者:
sangshuduo
提交者:
GitHub
3月 12, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5412 from taosdata/hotfix/sangshuduo/TD-3147-insert-rate-more-than-1s
Hotfix/sangshuduo/td 3147 insert rate more than 1s
上级
776c80a7
3793640e
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
32 addition
and
23 deletion
+32
-23
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+32
-21
tests/test-all.sh
tests/test-all.sh
+0
-2
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
2dd89ced
...
@@ -230,6 +230,7 @@ typedef struct SSuperTable_S {
...
@@ -230,6 +230,7 @@ typedef struct SSuperTable_S {
int
disorderRange
;
// ms or us by database precision
int
disorderRange
;
// ms or us by database precision
int
maxSqlLen
;
//
int
maxSqlLen
;
//
int
insertInterval
;
// insert interval, will override global insert interval
int64_t
insertRows
;
// 0: no limit
int64_t
insertRows
;
// 0: no limit
int
timeStampStep
;
int
timeStampStep
;
char
startTimestamp
[
MAX_TB_NAME_SIZE
];
//
char
startTimestamp
[
MAX_TB_NAME_SIZE
];
//
...
@@ -739,7 +740,8 @@ void parse_args(int argc, char *argv[], SArguments *arguments) {
...
@@ -739,7 +740,8 @@ void parse_args(int argc, char *argv[], SArguments *arguments) {
}
}
}
}
if
(
arguments
->
debug_print
)
{
if
(((
arguments
->
debug_print
)
&&
(
arguments
->
metaFile
==
NULL
))
||
arguments
->
verbose_print
)
{
printf
(
"###################################################################
\n
"
);
printf
(
"###################################################################
\n
"
);
printf
(
"# meta file: %s
\n
"
,
arguments
->
metaFile
);
printf
(
"# meta file: %s
\n
"
,
arguments
->
metaFile
);
printf
(
"# Server IP: %s:%hu
\n
"
,
printf
(
"# Server IP: %s:%hu
\n
"
,
...
@@ -1236,6 +1238,7 @@ static void printfInsertMetaToFile(FILE* fp) {
...
@@ -1236,6 +1238,7 @@ static void printfInsertMetaToFile(FILE* fp) {
fprintf
(
fp
,
" dataSource: %s
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
dataSource
);
fprintf
(
fp
,
" dataSource: %s
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
dataSource
);
fprintf
(
fp
,
" insertMode: %s
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertMode
);
fprintf
(
fp
,
" insertMode: %s
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertMode
);
fprintf
(
fp
,
" insertRows: %"
PRId64
"
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertRows
);
fprintf
(
fp
,
" insertRows: %"
PRId64
"
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertRows
);
fprintf
(
fp
,
" insert interval: %d
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertInterval
);
if
(
0
==
g_Dbs
.
db
[
i
].
superTbls
[
j
].
multiThreadWriteOneTbl
)
{
if
(
0
==
g_Dbs
.
db
[
i
].
superTbls
[
j
].
multiThreadWriteOneTbl
)
{
fprintf
(
fp
,
" multiThreadWriteOneTbl: no
\n
"
);
fprintf
(
fp
,
" multiThreadWriteOneTbl: no
\n
"
);
...
@@ -2823,13 +2826,13 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
...
@@ -2823,13 +2826,13 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
cJSON
*
i
nsertInterval
=
cJSON_GetObjectItem
(
root
,
"insert_interval"
);
cJSON
*
gI
nsertInterval
=
cJSON_GetObjectItem
(
root
,
"insert_interval"
);
if
(
insertInterval
&&
i
nsertInterval
->
type
==
cJSON_Number
)
{
if
(
gInsertInterval
&&
gI
nsertInterval
->
type
==
cJSON_Number
)
{
g_args
.
insert_interval
=
i
nsertInterval
->
valueint
;
g_args
.
insert_interval
=
gI
nsertInterval
->
valueint
;
}
else
if
(
!
i
nsertInterval
)
{
}
else
if
(
!
gI
nsertInterval
)
{
g_args
.
insert_interval
=
0
;
g_args
.
insert_interval
=
0
;
}
else
{
}
else
{
printf
(
"failed to read json, insert_interval
not found
"
);
printf
(
"failed to read json, insert_interval
input mistake
"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
...
@@ -3315,13 +3318,22 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
...
@@ -3315,13 +3318,22 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
cJSON
*
insertRows
=
cJSON_GetObjectItem
(
stbInfo
,
"insert_rows"
);
cJSON
*
insertRows
=
cJSON_GetObjectItem
(
stbInfo
,
"insert_rows"
);
if
(
insertRows
&&
insertRows
->
type
==
cJSON_Number
)
{
if
(
insertRows
&&
insertRows
->
type
==
cJSON_Number
)
{
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertRows
=
insertRows
->
valueint
;
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertRows
=
insertRows
->
valueint
;
//if (0 == g_Dbs.db[i].superTbls[j].insertRows) {
// g_Dbs.db[i].superTbls[j].insertRows = 0x7FFFFFFFFFFFFFFF;
//}
}
else
if
(
!
insertRows
)
{
}
else
if
(
!
insertRows
)
{
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertRows
=
0x7FFFFFFFFFFFFFFF
;
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertRows
=
0x7FFFFFFFFFFFFFFF
;
}
else
{
}
else
{
printf
(
"failed to read json, insert_rows not found"
);
printf
(
"failed to read json, insert_rows input mistake"
);
goto
PARSE_OVER
;
}
cJSON
*
insertInterval
=
cJSON_GetObjectItem
(
stbInfo
,
"insert_interval"
);
if
(
insertInterval
&&
insertInterval
->
type
==
cJSON_Number
)
{
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertInterval
=
insertInterval
->
valueint
;
}
else
if
(
!
insertInterval
)
{
debugPrint
(
"%s() LN%d: stable insert interval be overrided by global %d.
\n
"
,
__func__
,
__LINE__
,
g_args
.
insert_interval
);
g_Dbs
.
db
[
i
].
superTbls
[
j
].
insertInterval
=
g_args
.
insert_interval
;
}
else
{
printf
(
"failed to read json, insert_interval input mistake"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
...
@@ -4008,7 +4020,7 @@ static void syncWriteForNumberOfTblInOneSql(
...
@@ -4008,7 +4020,7 @@ static void syncWriteForNumberOfTblInOneSql(
send_to_server:
send_to_server:
if
(
g_args
.
insert_interval
&&
(
g_args
.
insert_interval
>
(
et
-
st
)))
{
if
(
g_args
.
insert_interval
&&
(
g_args
.
insert_interval
>
(
et
-
st
)))
{
int
sleep_time
=
g_args
.
insert_interval
-
(
et
-
st
);
int
sleep_time
=
g_args
.
insert_interval
-
(
et
-
st
);
printf
(
"sleep: %d ms
specified by insert_
interval
\n
"
,
sleep_time
);
printf
(
"sleep: %d ms
insert
interval
\n
"
,
sleep_time
);
taosMsleep
(
sleep_time
);
// ms
taosMsleep
(
sleep_time
);
// ms
}
}
...
@@ -4351,14 +4363,14 @@ static void* syncWriteWithStb(void *sarg) {
...
@@ -4351,14 +4363,14 @@ static void* syncWriteWithStb(void *sarg) {
int64_t
tblInserted
=
i
;
int64_t
tblInserted
=
i
;
if
(
i
>
0
&&
g_args
.
insert_interval
if
(
i
>
0
&&
superTblInfo
->
insertInterval
&&
(
g_args
.
insert_i
nterval
>
(
et
-
st
)
))
{
&&
(
superTblInfo
->
insertI
nterval
>
(
et
-
st
)
))
{
int
sleep_time
=
g_args
.
insert_i
nterval
-
(
et
-
st
);
int
sleep_time
=
superTblInfo
->
insertI
nterval
-
(
et
-
st
);
printf
(
"sleep: %d ms
specified by insert_
interval
\n
"
,
sleep_time
);
printf
(
"sleep: %d ms
insert
interval
\n
"
,
sleep_time
);
taosMsleep
(
sleep_time
);
// ms
taosMsleep
(
sleep_time
);
// ms
}
}
if
(
g_args
.
insert_i
nterval
)
{
if
(
superTblInfo
->
insertI
nterval
)
{
st
=
taosGetTimestampMs
();
st
=
taosGetTimestampMs
();
}
}
...
@@ -4499,7 +4511,7 @@ static void* syncWriteWithStb(void *sarg) {
...
@@ -4499,7 +4511,7 @@ static void* syncWriteWithStb(void *sarg) {
lastPrintTime
=
currentPrintTime
;
lastPrintTime
=
currentPrintTime
;
}
}
if
(
g_args
.
insert_i
nterval
)
{
if
(
superTblInfo
->
insertI
nterval
)
{
et
=
taosGetTimestampMs
();
et
=
taosGetTimestampMs
();
}
}
...
@@ -4514,7 +4526,6 @@ static void* syncWriteWithStb(void *sarg) {
...
@@ -4514,7 +4526,6 @@ static void* syncWriteWithStb(void *sarg) {
}
}
}
}
//printf("========loop %d childTables duration:%"PRId64 "========inserted rows:%d\n", winfo->end_table_id - winfo->start_table_id, et - st, i);
}
// tID
}
// tID
free_and_statistics_2:
free_and_statistics_2:
...
...
tests/test-all.sh
浏览文件 @
2dd89ced
...
@@ -316,7 +316,6 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "unit" ] && [ "$1" ==
...
@@ -316,7 +316,6 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "unit" ] && [ "$1" ==
cd
debug/
cd
debug/
stopTaosd
stopTaosd
rm
-rf
/var/lib/taos/
*
nohup
build/bin/taosd
-c
/etc/taos/
>
/dev/null 2>&1 &
nohup
build/bin/taosd
-c
/etc/taos/
>
/dev/null 2>&1 &
sleep
30
sleep
30
...
@@ -359,7 +358,6 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "jdbc" ] && [ "$1" ==
...
@@ -359,7 +358,6 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "jdbc" ] && [ "$1" ==
pwd
pwd
cd
debug/build/bin
cd
debug/build/bin
rm
-rf
/var/lib/taos/
*
nohup
./taosd
-c
/etc/taos/
>
/dev/null 2>&1 &
nohup
./taosd
-c
/etc/taos/
>
/dev/null 2>&1 &
sleep
30
sleep
30
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录