Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e130f9f2
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e130f9f2
编写于
8月 08, 2021
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5875]<featur>: taosdemo show progress
上级
2987b861
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
2 deletion
+20
-2
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+20
-2
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
e130f9f2
...
@@ -246,7 +246,6 @@ typedef struct SArguments_S {
...
@@ -246,7 +246,6 @@ typedef struct SArguments_S {
uint32_t
disorderRatio
;
// 0: no disorder, >0: x%
uint32_t
disorderRatio
;
// 0: no disorder, >0: x%
int
disorderRange
;
// ms, us or ns. accordig to database precision
int
disorderRange
;
// ms, us or ns. accordig to database precision
uint32_t
method_of_delete
;
uint32_t
method_of_delete
;
char
**
arg_list
;
uint64_t
totalInsertRows
;
uint64_t
totalInsertRows
;
uint64_t
totalAffectedRows
;
uint64_t
totalAffectedRows
;
bool
demo_mode
;
// use default column name and semi-random data
bool
demo_mode
;
// use default column name and semi-random data
...
@@ -638,7 +637,6 @@ SArguments g_args = {
...
@@ -638,7 +637,6 @@ SArguments g_args = {
0
,
// disorderRatio
0
,
// disorderRatio
1000
,
// disorderRange
1000
,
// disorderRange
1
,
// method_of_delete
1
,
// method_of_delete
NULL
,
// arg_list
0
,
// totalInsertRows;
0
,
// totalInsertRows;
0
,
// totalAffectedRows;
0
,
// totalAffectedRows;
true
,
// demo_mode;
true
,
// demo_mode;
...
@@ -6401,6 +6399,9 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
...
@@ -6401,6 +6399,9 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
bool
flagSleep
=
true
;
bool
flagSleep
=
true
;
uint64_t
sleepTimeTotal
=
0
;
uint64_t
sleepTimeTotal
=
0
;
int
percentComplete
=
0
;
int64_t
totalRows
=
insertRows
*
pThreadInfo
->
ntables
;
while
(
pThreadInfo
->
totalInsertRows
<
pThreadInfo
->
ntables
*
insertRows
)
{
while
(
pThreadInfo
->
totalInsertRows
<
pThreadInfo
->
ntables
*
insertRows
)
{
if
((
flagSleep
)
&&
(
insert_interval
))
{
if
((
flagSleep
)
&&
(
insert_interval
))
{
st
=
taosGetTimestampMs
();
st
=
taosGetTimestampMs
();
...
@@ -6577,6 +6578,11 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
...
@@ -6577,6 +6578,11 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
pThreadInfo
->
totalAffectedRows
+=
affectedRows
;
pThreadInfo
->
totalAffectedRows
+=
affectedRows
;
int
currentPercent
=
pThreadInfo
->
totalAffectedRows
*
100
/
totalRows
;
if
(
currentPercent
>
percentComplete
)
{
printf
(
"[%d]:%d%%
\n
"
,
pThreadInfo
->
threadID
,
currentPercent
);
percentComplete
=
currentPercent
;
}
int64_t
currentPrintTime
=
taosGetTimestampMs
();
int64_t
currentPrintTime
=
taosGetTimestampMs
();
if
(
currentPrintTime
-
lastPrintTime
>
30
*
1000
)
{
if
(
currentPrintTime
-
lastPrintTime
>
30
*
1000
)
{
printf
(
"thread[%d] has currently inserted rows: %"
PRIu64
", affected rows: %"
PRIu64
"
\n
"
,
printf
(
"thread[%d] has currently inserted rows: %"
PRIu64
", affected rows: %"
PRIu64
"
\n
"
,
...
@@ -6598,6 +6604,8 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
...
@@ -6598,6 +6604,8 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
}
}
}
}
}
}
if
(
percentComplete
<
100
)
printf
(
"[%d]:%d%%
\n
"
,
pThreadInfo
->
threadID
,
percentComplete
);
free_of_interlace:
free_of_interlace:
tmfree
(
pThreadInfo
->
buffer
);
tmfree
(
pThreadInfo
->
buffer
);
...
@@ -6635,6 +6643,9 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
...
@@ -6635,6 +6643,9 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
pThreadInfo
->
samplePos
=
0
;
pThreadInfo
->
samplePos
=
0
;
int
percentComplete
=
0
;
int64_t
totalRows
=
insertRows
*
pThreadInfo
->
ntables
;
for
(
uint64_t
tableSeq
=
pThreadInfo
->
start_table_from
;
for
(
uint64_t
tableSeq
=
pThreadInfo
->
start_table_from
;
tableSeq
<=
pThreadInfo
->
end_table_to
;
tableSeq
<=
pThreadInfo
->
end_table_to
;
tableSeq
++
)
{
tableSeq
++
)
{
...
@@ -6740,6 +6751,11 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
...
@@ -6740,6 +6751,11 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
pThreadInfo
->
totalAffectedRows
+=
affectedRows
;
pThreadInfo
->
totalAffectedRows
+=
affectedRows
;
int
currentPercent
=
pThreadInfo
->
totalAffectedRows
*
100
/
totalRows
;
if
(
currentPercent
>
percentComplete
)
{
printf
(
"[%d]:%d%%
\n
"
,
pThreadInfo
->
threadID
,
currentPercent
);
percentComplete
=
currentPercent
;
}
int64_t
currentPrintTime
=
taosGetTimestampMs
();
int64_t
currentPrintTime
=
taosGetTimestampMs
();
if
(
currentPrintTime
-
lastPrintTime
>
30
*
1000
)
{
if
(
currentPrintTime
-
lastPrintTime
>
30
*
1000
)
{
printf
(
"thread[%d] has currently inserted rows: %"
PRId64
", affected rows: %"
PRId64
"
\n
"
,
printf
(
"thread[%d] has currently inserted rows: %"
PRId64
", affected rows: %"
PRId64
"
\n
"
,
...
@@ -6762,6 +6778,8 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
...
@@ -6762,6 +6778,8 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
__func__
,
__LINE__
,
pThreadInfo
->
samplePos
);
__func__
,
__LINE__
,
pThreadInfo
->
samplePos
);
}
}
}
// tableSeq
}
// tableSeq
if
(
percentComplete
<
100
)
printf
(
"[%d]:%d%%
\n
"
,
pThreadInfo
->
threadID
,
percentComplete
);
free_of_progressive:
free_of_progressive:
tmfree
(
pThreadInfo
->
buffer
);
tmfree
(
pThreadInfo
->
buffer
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录