Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
f0c988d9
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看板
提交
f0c988d9
编写于
8月 05, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5505]<fix>: add taosParseTime profiling unitTests
上级
d2dcecda
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
58 addition
and
0 deletion
+58
-0
src/query/tests/unitTest.cpp
src/query/tests/unitTest.cpp
+58
-0
未找到文件。
src/query/tests/unitTest.cpp
浏览文件 @
f0c988d9
...
...
@@ -524,6 +524,64 @@ TEST(testCase, parse_time) {
}
/* test parse time profiling */
TEST
(
testCase
,
parse_time_profile
)
{
taos_options
(
TSDB_OPTION_TIMEZONE
,
"GMT-8"
);
char
t1
[]
=
"2018-1-8 1:1:1.952"
;
char
t2
[]
=
"2018-1-8T1:1:1.952+0800"
;
char
t3
[]
=
"2018-1-8 1:1:1.952+0800"
;
char
t4
[]
=
"2018-1-81:1:1.952+0800"
;
char
t5
[]
=
"2018-1-8 1:1:1.952"
;
char
t6
[]
=
"2018-1-8T1:1:1.952+08:00"
;
char
t7
[]
=
"2018-1-8 1:1:1.952+08:00"
;
char
t8
[]
=
"2018-1-81:1:1.952+08:00"
;
char
t9
[]
=
"2018-1-8 1:1:1.952"
;
char
t10
[]
=
"2018-1-8T1:1:1.952Z"
;
char
t11
[]
=
"2018-1-8 1:1:1.952z"
;
char
t12
[]
=
"2018-1-81:1:1.952Z"
;
struct
timeval
start
,
end
;
int64_t
time
=
0
,
time1
=
0
;
int32_t
total_run
=
100000000
;
long
total_time_us
;
gettimeofday
(
&
start
,
NULL
);
for
(
int
i
=
0
;
i
<
total_run
;
++
i
)
{
taosParseTime
(
t1
,
&
time
,
strlen
(
t1
),
TSDB_TIME_PRECISION_MILLI
,
0
);
}
gettimeofday
(
&
end
,
NULL
);
total_time_us
=
((
end
.
tv_sec
-
start
.
tv_sec
)
*
1000000
)
+
(
end
.
tv_usec
-
start
.
tv_usec
);
printf
(
"[t1] The elapsed time is %f seconds in %d run, average:%fns
\n
"
,
total_time_us
/
1000000.0
,
total_run
,
1000
*
(
float
)
total_time_us
/
(
float
)
total_run
);
gettimeofday
(
&
start
,
NULL
);
for
(
int
i
=
0
;
i
<
total_run
;
++
i
)
{
taosParseTime
(
t2
,
&
time
,
strlen
(
t2
),
TSDB_TIME_PRECISION_MILLI
,
0
);
}
gettimeofday
(
&
end
,
NULL
);
total_time_us
=
((
end
.
tv_sec
-
start
.
tv_sec
)
*
1000000
)
+
(
end
.
tv_usec
-
start
.
tv_usec
);
printf
(
"[t2] The elapsed time is %f seconds in %d run, average:%fns
\n
"
,
total_time_us
/
1000000.0
,
total_run
,
1000
*
(
float
)
total_time_us
/
(
float
)
total_run
);
gettimeofday
(
&
start
,
NULL
);
for
(
int
i
=
0
;
i
<
total_run
;
++
i
)
{
taosParseTime
(
t3
,
&
time
,
strlen
(
t3
),
TSDB_TIME_PRECISION_MILLI
,
0
);
}
gettimeofday
(
&
end
,
NULL
);
total_time_us
=
((
end
.
tv_sec
-
start
.
tv_sec
)
*
1000000
)
+
(
end
.
tv_usec
-
start
.
tv_usec
);
printf
(
"[t3] The elapsed time is %f seconds in %d run, average:%fns
\n
"
,
total_time_us
/
1000000.0
,
total_run
,
1000
*
(
float
)
total_time_us
/
(
float
)
total_run
);
gettimeofday
(
&
start
,
NULL
);
for
(
int
i
=
0
;
i
<
total_run
;
++
i
)
{
taosParseTime
(
t4
,
&
time
,
strlen
(
t4
),
TSDB_TIME_PRECISION_MILLI
,
0
);
}
gettimeofday
(
&
end
,
NULL
);
total_time_us
=
((
end
.
tv_sec
-
start
.
tv_sec
)
*
1000000
)
+
(
end
.
tv_usec
-
start
.
tv_usec
);
printf
(
"[t4] The elapsed time is %f seconds in %d run, average:%fns
\n
"
,
total_time_us
/
1000000.0
,
total_run
,
1000
*
(
float
)
total_time_us
/
(
float
)
total_run
);
}
TEST
(
testCase
,
tvariant_convert
)
{
// 1. bool data to all other data types
tVariant
t
=
{
0
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录