Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
94bb5fe8
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
94bb5fe8
编写于
3月 23, 2021
作者:
sangshuduo
提交者:
GitHub
3月 23, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-3407] <fix>: print more info to result file. (#5538)
Co-authored-by:
N
Shuduo Sang
<
sdsang@taosdata.com
>
上级
0f6b54a4
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
17 addition
and
8 deletion
+17
-8
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+17
-8
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
94bb5fe8
...
...
@@ -1064,6 +1064,7 @@ static int printfInsertMeta() {
printf
(
"max sql length:
\033
[33m%d
\033
[0m
\n
"
,
g_args
.
max_sql_len
);
printf
(
"database count:
\033
[33m%d
\033
[0m
\n
"
,
g_Dbs
.
dbCount
);
for
(
int
i
=
0
;
i
<
g_Dbs
.
dbCount
;
i
++
)
{
printf
(
"database[
\033
[33m%d
\033
[0m]:
\n
"
,
i
);
printf
(
" database[%d] name:
\033
[33m%s
\033
[0m
\n
"
,
i
,
g_Dbs
.
db
[
i
].
dbName
);
...
...
@@ -1220,16 +1221,19 @@ static int printfInsertMeta() {
}
static
void
printfInsertMetaToFile
(
FILE
*
fp
)
{
SHOW_PARSE_RESULT_START_TO_FILE
(
fp
);
fprintf
(
fp
,
"host: %s:%u
\n
"
,
g_Dbs
.
host
,
g_Dbs
.
port
);
fprintf
(
fp
,
"user: %s
\n
"
,
g_Dbs
.
user
);
fprintf
(
fp
,
"password: %s
\n
"
,
g_Dbs
.
password
);
fprintf
(
fp
,
"resultFile: %s
\n
"
,
g_Dbs
.
resultFile
);
fprintf
(
fp
,
"thread num of insert data: %d
\n
"
,
g_Dbs
.
threadCount
);
fprintf
(
fp
,
"thread num of create table: %d
\n
"
,
g_Dbs
.
threadCountByCreateTbl
);
fprintf
(
fp
,
"insert interval: %d
\n
"
,
g_args
.
insert_interval
);
fprintf
(
fp
,
"number of records per req: %d
\n
"
,
g_args
.
num_of_RPR
);
fprintf
(
fp
,
"max sql length: %d
\n
"
,
g_args
.
max_sql_len
);
fprintf
(
fp
,
"database count: %d
\n
"
,
g_Dbs
.
dbCount
);
for
(
int
i
=
0
;
i
<
g_Dbs
.
dbCount
;
i
++
)
{
fprintf
(
fp
,
"database[%d]:
\n
"
,
i
);
fprintf
(
fp
,
" database[%d] name: %s
\n
"
,
i
,
g_Dbs
.
db
[
i
].
dbName
);
...
...
@@ -1364,11 +1368,14 @@ static void printfInsertMetaToFile(FILE* fp) {
}
fprintf
(
fp
,
"
\n
"
);
}
SHOW_PARSE_RESULT_END_TO_FILE
(
fp
);
}
static
void
printfQueryMeta
()
{
SHOW_PARSE_RESULT_START
();
printf
(
"host:
\033
[33m%s:%u
\033
[0m
\n
"
,
g_queryInfo
.
host
,
g_queryInfo
.
port
);
printf
(
"user:
\033
[33m%s
\033
[0m
\n
"
,
g_queryInfo
.
user
);
...
...
@@ -1415,7 +1422,7 @@ static void printfQueryMeta() {
}
static
char
*
xF
ormatTimestamp
(
char
*
buf
,
int64_t
val
,
int
precision
)
{
static
char
*
f
ormatTimestamp
(
char
*
buf
,
int64_t
val
,
int
precision
)
{
time_t
tt
;
if
(
precision
==
TSDB_TIME_PRECISION_MICRO
)
{
tt
=
(
time_t
)(
val
/
1000000
);
...
...
@@ -1447,7 +1454,9 @@ static char* xFormatTimestamp(char* buf, int64_t val, int precision) {
return
buf
;
}
static
void
xDumpFieldToFile
(
FILE
*
fp
,
const
char
*
val
,
TAOS_FIELD
*
field
,
int32_t
length
,
int
precision
)
{
static
void
xDumpFieldToFile
(
FILE
*
fp
,
const
char
*
val
,
TAOS_FIELD
*
field
,
int32_t
length
,
int
precision
)
{
if
(
val
==
NULL
)
{
fprintf
(
fp
,
"%s"
,
TSDB_DATA_NULL_STR
);
return
;
...
...
@@ -1483,7 +1492,7 @@ static void xDumpFieldToFile(FILE* fp, const char* val, TAOS_FIELD* field, int32
fprintf
(
fp
,
"
\'
%s
\'
"
,
buf
);
break
;
case
TSDB_DATA_TYPE_TIMESTAMP
:
xF
ormatTimestamp
(
buf
,
*
(
int64_t
*
)
val
,
precision
);
f
ormatTimestamp
(
buf
,
*
(
int64_t
*
)
val
,
precision
);
fprintf
(
fp
,
"'%s'"
,
buf
);
break
;
default:
...
...
@@ -1562,7 +1571,7 @@ static int getDbFromServer(TAOS * taos, SDbInfo** dbInfos) {
tstrncpy
(
dbInfos
[
count
]
->
name
,
(
char
*
)
row
[
TSDB_SHOW_DB_NAME_INDEX
],
fields
[
TSDB_SHOW_DB_NAME_INDEX
].
bytes
);
xF
ormatTimestamp
(
dbInfos
[
count
]
->
create_time
,
f
ormatTimestamp
(
dbInfos
[
count
]
->
create_time
,
*
(
int64_t
*
)
row
[
TSDB_SHOW_DB_CREATED_TIME_INDEX
],
TSDB_TIME_PRECISION_MILLI
);
dbInfos
[
count
]
->
ntables
=
*
((
int32_t
*
)
row
[
TSDB_SHOW_DB_NTABLES_INDEX
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录