Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d10cce1e
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
未验证
提交
d10cce1e
编写于
5月 21, 2022
作者:
Y
Yang Zhao
提交者:
GitHub
5月 21, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: add absolute execute file path in taosbenchmark develop test (#12309)
上级
b8c8bc4a
变更
17
显示空白变更内容
内联
并排
Showing
17 changed file
with
456 addition
and
65 deletion
+456
-65
tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py
...test/5-taos-tools/taosbenchmark/auto_create_table_json.py
+27
-4
tests/develop-test/5-taos-tools/taosbenchmark/commandline.py
tests/develop-test/5-taos-tools/taosbenchmark/commandline.py
+55
-32
tests/develop-test/5-taos-tools/taosbenchmark/custom_col_tag.py
...develop-test/5-taos-tools/taosbenchmark/custom_col_tag.py
+24
-1
tests/develop-test/5-taos-tools/taosbenchmark/default_json.py
...s/develop-test/5-taos-tools/taosbenchmark/default_json.py
+24
-1
tests/develop-test/5-taos-tools/taosbenchmark/demo.py
tests/develop-test/5-taos-tools/taosbenchmark/demo.py
+24
-1
tests/develop-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py
...p-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py
+27
-4
tests/develop-test/5-taos-tools/taosbenchmark/invalid_commandline.py
...op-test/5-taos-tools/taosbenchmark/invalid_commandline.py
+30
-7
tests/develop-test/5-taos-tools/taosbenchmark/json_tag.py
tests/develop-test/5-taos-tools/taosbenchmark/json_tag.py
+24
-1
tests/develop-test/5-taos-tools/taosbenchmark/limit_offset_json.py
...elop-test/5-taos-tools/taosbenchmark/limit_offset_json.py
+25
-2
tests/develop-test/5-taos-tools/taosbenchmark/query_json.py
tests/develop-test/5-taos-tools/taosbenchmark/query_json.py
+25
-2
tests/develop-test/5-taos-tools/taosbenchmark/sample_csv_json.py
...evelop-test/5-taos-tools/taosbenchmark/sample_csv_json.py
+24
-1
tests/develop-test/5-taos-tools/taosbenchmark/sml_interlace.py
.../develop-test/5-taos-tools/taosbenchmark/sml_interlace.py
+24
-1
tests/develop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py
...elop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py
+24
-1
tests/develop-test/5-taos-tools/taosbenchmark/sml_telnet_alltypes.py
...op-test/5-taos-tools/taosbenchmark/sml_telnet_alltypes.py
+24
-1
tests/develop-test/5-taos-tools/taosbenchmark/subscripe_json.py
...develop-test/5-taos-tools/taosbenchmark/subscripe_json.py
+25
-2
tests/develop-test/5-taos-tools/taosbenchmark/taosadapter_json.py
...velop-test/5-taos-tools/taosbenchmark/taosadapter_json.py
+26
-3
tests/develop-test/5-taos-tools/taosbenchmark/telnet_tcp.py
tests/develop-test/5-taos-tools/taosbenchmark/telnet_tcp.py
+24
-1
未找到文件。
tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py
浏览文件 @
d10cce1e
...
...
@@ -28,8 +28,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_auto_create_table.json"
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/taosc_auto_create_table.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
@@ -76,7 +99,7 @@ class TDTestCase:
tdSql
.
query
(
"select distinct(c12) from db.`stb1-2`"
)
tdSql
.
checkData
(
0
,
0
,
None
)
cmd
=
"
taosBenchmark -f ./5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json"
cmd
=
"
%s -f ./5-taos-tools/taosbenchmark/json/stmt_auto_create_table.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
@@ -93,7 +116,7 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from db.`stb2-2`"
)
tdSql
.
checkData
(
0
,
0
,
160
)
cmd
=
"
taosBenchmark -f ./5-taos-tools/taosbenchmark/json/rest_auto_create_table.json"
cmd
=
"
%s -f ./5-taos-tools/taosbenchmark/json/rest_auto_create_table.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
@@ -110,7 +133,7 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from db.`stb3-2`"
)
tdSql
.
checkData
(
0
,
0
,
160
)
cmd
=
"
taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_auto_create_table.json"
cmd
=
"
%s -f ./5-taos-tools/taosbenchmark/json/sml_auto_create_table.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/commandline.py
浏览文件 @
d10cce1e
...
...
@@ -31,8 +31,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -F 7 -H 9 -n 10 -t 2 -x -y -M -C -d newtest -l 5 -A binary,nchar\(31\) -b tinyint,binary\(23\),bool,nchar -w 29 -E -m $%^*"
binPath
=
self
.
getPath
()
cmd
=
"%s -F 7 -H 9 -n 10 -t 2 -x -y -M -C -d newtest -l 5 -A binary,nchar\(31\) -b tinyint,binary\(23\),bool,nchar -w 29 -E -m $%^*"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"use newtest"
)
...
...
@@ -58,7 +81,7 @@ class TDTestCase:
tdSql
.
checkRows
(
2
)
tdSql
.
execute
(
"drop database if exists newtest"
)
cmd
=
"
taosBenchmark -F 7 -n 10 -t 2 -y -M -I stmt"
cmd
=
"
%s -F 7 -n 10 -t 2 -y -M -I stmt"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
query
(
"select count(tbname) from test.meters"
)
...
...
@@ -66,55 +89,55 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from test.meters"
)
tdSql
.
checkData
(
0
,
0
,
20
)
cmd
=
"
taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 2>&1 | grep sleep | wc -l"
cmd
=
"
%s -n 3 -t 3 -B 2 -i 1 -G -y -T 1 2>&1 | grep sleep | wc -l"
%
binPath
sleepTimes
=
subprocess
.
check_output
(
cmd
,
shell
=
True
).
decode
(
"utf-8"
)
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
if
(
int
(
sleepTimes
)
!=
2
):
tdLog
.
exit
(
"expected sleep times 2, actual %d"
%
int
(
sleepTimes
))
cmd
=
"
taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -r 1 2>&1 | grep sleep | wc -l"
cmd
=
"
%s -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -r 1 2>&1 | grep sleep | wc -l"
%
binPath
sleepTimes
=
subprocess
.
check_output
(
cmd
,
shell
=
True
).
decode
(
"utf-8"
)
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
if
(
int
(
sleepTimes
)
!=
3
):
tdLog
.
exit
(
"expected sleep times 3, actual %d"
%
int
(
sleepTimes
))
cmd
=
"
taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -I sml 2>&1 | grep sleep | wc -l"
cmd
=
"
%s -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -I sml 2>&1 | grep sleep | wc -l"
%
binPath
sleepTimes
=
subprocess
.
check_output
(
cmd
,
shell
=
True
).
decode
(
"utf-8"
)
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
if
(
int
(
sleepTimes
)
!=
2
):
tdLog
.
exit
(
"expected sleep times 2, actual %d"
%
int
(
sleepTimes
))
cmd
=
"
taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -r 1 -I sml 2>&1 | grep sleep | wc -l"
cmd
=
"
%s -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -r 1 -I sml 2>&1 | grep sleep | wc -l"
%
binPath
sleepTimes
=
subprocess
.
check_output
(
cmd
,
shell
=
True
).
decode
(
"utf-8"
)
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
if
(
int
(
sleepTimes
)
!=
3
):
tdLog
.
exit
(
"expected sleep times 3, actual %d"
%
int
(
sleepTimes
))
cmd
=
"
taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -I stmt 2>&1 | grep sleep | wc -l"
cmd
=
"
%s -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -I stmt 2>&1 | grep sleep | wc -l"
%
binPath
sleepTimes
=
subprocess
.
check_output
(
cmd
,
shell
=
True
).
decode
(
"utf-8"
)
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
if
(
int
(
sleepTimes
)
!=
2
):
tdLog
.
exit
(
"expected sleep times 2, actual %d"
%
int
(
sleepTimes
))
cmd
=
"
taosBenchmark -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -r 1 -I stmt 2>&1 | grep sleep | wc -l"
cmd
=
"
%s -n 3 -t 3 -B 2 -i 1 -G -y -T 1 -r 1 -I stmt 2>&1 | grep sleep | wc -l"
%
binPath
sleepTimes
=
subprocess
.
check_output
(
cmd
,
shell
=
True
).
decode
(
"utf-8"
)
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
if
(
int
(
sleepTimes
)
!=
3
):
tdLog
.
exit
(
"expected sleep times 3, actual %d"
%
int
(
sleepTimes
))
cmd
=
"
taosBenchmark -S 17 -n 3 -t 1 -y -x"
cmd
=
"
%s -S 17 -n 3 -t 1 -y -x"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
query
(
"select last(ts) from test.meters"
)
tdSql
.
checkData
(
0
,
0
,
"2017-07-14 10:40:00.034"
)
cmd
=
"
taosBenchmark -N -I taosc -t 11 -n 11 -y -x -E"
cmd
=
"
%s -N -I taosc -t 11 -n 11 -y -x -E"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"use test"
)
...
...
@@ -125,7 +148,7 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from `d10`"
)
tdSql
.
checkData
(
0
,
0
,
11
)
cmd
=
"
taosBenchmark -N -I rest -t 11 -n 11 -y -x"
cmd
=
"
%s -N -I rest -t 11 -n 11 -y -x"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"use test"
)
...
...
@@ -136,7 +159,7 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from d10"
)
tdSql
.
checkData
(
0
,
0
,
11
)
cmd
=
"
taosBenchmark -N -I stmt -t 11 -n 11 -y -x"
cmd
=
"
%s -N -I stmt -t 11 -n 11 -y -x"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"use test"
)
...
...
@@ -147,134 +170,134 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from d10"
)
tdSql
.
checkData
(
0
,
0
,
11
)
cmd
=
"
taosBenchmark -N -I sml -y"
cmd
=
"
%s -N -I sml -y"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
assert
(
os
.
system
(
"%s"
%
cmd
)
!=
0
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b bool"
cmd
=
"
%s -n 1 -t 1 -y -b bool"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"BOOL"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b tinyint"
cmd
=
"
%s -n 1 -t 1 -y -b tinyint"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"TINYINT"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b utinyint"
cmd
=
"
%s -n 1 -t 1 -y -b utinyint"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"TINYINT UNSIGNED"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b smallint"
cmd
=
"
%s -n 1 -t 1 -y -b smallint"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"SMALLINT"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b usmallint"
cmd
=
"
%s -n 1 -t 1 -y -b usmallint"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"SMALLINT UNSIGNED"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b int"
cmd
=
"
%s -n 1 -t 1 -y -b int"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"INT"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b uint"
cmd
=
"
%s -n 1 -t 1 -y -b uint"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"INT UNSIGNED"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b bigint"
cmd
=
"
%s -n 1 -t 1 -y -b bigint"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"BIGINT"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b ubigint"
cmd
=
"
%s -n 1 -t 1 -y -b ubigint"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"BIGINT UNSIGNED"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b timestamp"
cmd
=
"
%s -n 1 -t 1 -y -b timestamp"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"TIMESTAMP"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b float"
cmd
=
"
%s -n 1 -t 1 -y -b float"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"FLOAT"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b double"
cmd
=
"
%s -n 1 -t 1 -y -b double"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"DOUBLE"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b nchar"
cmd
=
"
%s -n 1 -t 1 -y -b nchar"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"NCHAR"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b nchar\(7\)"
cmd
=
"
%s -n 1 -t 1 -y -b nchar\(7\)"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"NCHAR"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b binary"
cmd
=
"
%s -n 1 -t 1 -y -b binary"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"BINARY"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b binary\(7\)"
cmd
=
"
%s -n 1 -t 1 -y -b binary\(7\)"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
1
,
1
,
"BINARY"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -A json\(7\)"
cmd
=
"
%s -n 1 -t 1 -y -A json\(7\)"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"describe test.meters"
)
tdSql
.
checkData
(
4
,
1
,
"JSON"
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -b int,x"
cmd
=
"
%s -n 1 -t 1 -y -b int,x"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
assert
(
os
.
system
(
"%s"
%
cmd
)
!=
0
)
cmd
=
"
taosBenchmark -n 1 -t 1 -y -A int,json"
cmd
=
"
%s -n 1 -t 1 -y -A int,json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
assert
(
os
.
system
(
"%s"
%
cmd
)
!=
0
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/custom_col_tag.py
浏览文件 @
d10cce1e
...
...
@@ -28,8 +28,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -f ./5-taos-tools/taosbenchmark/json/custom_col_tag.json"
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/custom_col_tag.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/default_json.py
浏览文件 @
d10cce1e
...
...
@@ -28,8 +28,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -f ./5-taos-tools/taosbenchmark/json/default.json"
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/default.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/demo.py
浏览文件 @
d10cce1e
...
...
@@ -31,8 +31,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -n 100 -t 100 -y"
binPath
=
self
.
getPath
()
cmd
=
"%s -n 100 -t 100 -y"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"use test"
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py
浏览文件 @
d10cce1e
...
...
@@ -28,8 +28,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_insert_alltypes.json"
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/taosc_insert_alltypes.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
query
(
"select count(*) from db.stb"
)
...
...
@@ -124,7 +147,7 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
160
)
cmd
=
"
taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_insert_alltypes.json"
cmd
=
"
%s -f ./5-taos-tools/taosbenchmark/json/sml_insert_alltypes.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
query
(
"select count(*) from db.stb"
)
...
...
@@ -162,7 +185,7 @@ class TDTestCase:
tdSql
.
checkData
(
25
,
1
,
"NCHAR"
)
tdSql
.
checkData
(
26
,
1
,
"NCHAR"
)
cmd
=
"
taosBenchmark -f ./5-taos-tools/taosbenchmark/json/rest_insert_alltypes.json"
cmd
=
"
%s -f ./5-taos-tools/taosbenchmark/json/rest_insert_alltypes.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
query
(
"select count(*) from db.stb"
)
...
...
@@ -204,7 +227,7 @@ class TDTestCase:
tdSql
.
checkData
(
28
,
1
,
"BINARY"
)
tdSql
.
checkData
(
28
,
2
,
19
)
cmd
=
"
taosBenchmark -f ./5-taos-tools/taosbenchmark/json/stmt_insert_alltypes.json"
cmd
=
"
%s -f ./5-taos-tools/taosbenchmark/json/stmt_insert_alltypes.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
query
(
"select count(*) from db.stb"
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/invalid_commandline.py
浏览文件 @
d10cce1e
...
...
@@ -28,34 +28,57 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -F abc -P abc -I abc -T abc -H abc -i abc -S abc -B abc -r abc -t abc -n abc -l abc -w abc -w 16385 -R abc -O abc -a abc -n 2 -t 2 -r 1 -y"
binPath
=
self
.
getPath
()
cmd
=
"%s -F abc -P abc -I abc -T abc -H abc -i abc -S abc -B abc -r abc -t abc -n abc -l abc -w abc -w 16385 -R abc -O abc -a abc -n 2 -t 2 -r 1 -y"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
query
(
"select count(*) from test.meters"
)
tdSql
.
checkData
(
0
,
0
,
4
)
cmd
=
"
taosBenchmark non_exist_opt"
cmd
=
"
%s non_exist_opt"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
assert
(
os
.
system
(
"%s"
%
cmd
)
!=
0
)
cmd
=
"
taosBenchmark -f non_exist_file"
cmd
=
"
%s -f non_exist_file"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
assert
(
os
.
system
(
"%s"
%
cmd
)
!=
0
)
cmd
=
"
taosBenchmark -h non_exist_host"
cmd
=
"
%s -h non_exist_host"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
assert
(
os
.
system
(
"%s"
%
cmd
)
!=
0
)
cmd
=
"
taosBenchmark -p non_exist_pass"
cmd
=
"
%s -p non_exist_pass"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
assert
(
os
.
system
(
"%s"
%
cmd
)
!=
0
)
cmd
=
"
taosBenchmark -u non_exist_user"
cmd
=
"
%s -u non_exist_user"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
assert
(
os
.
system
(
"%s"
%
cmd
)
!=
0
)
cmd
=
"
taosBenchmark -c non_exist_dir -n 1 -t 1 -o non_exist_path -y"
cmd
=
"
%s -c non_exist_dir -n 1 -t 1 -o non_exist_path -y"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
assert
(
os
.
system
(
"%s"
%
cmd
)
==
0
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/json_tag.py
浏览文件 @
d10cce1e
...
...
@@ -28,8 +28,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_json_tag.json"
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/taosc_json_tag.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/limit_offset_json.py
浏览文件 @
d10cce1e
...
...
@@ -28,8 +28,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_only_create_table.json"
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/taosc_only_create_table.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
@@ -48,7 +71,7 @@ class TDTestCase:
tdSql
.
checkData
(
28
,
2
,
64
)
cmd
=
"
taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_limit_offset.json"
cmd
=
"
%s -f ./5-taos-tools/taosbenchmark/json/taosc_limit_offset.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/query_json.py
浏览文件 @
d10cce1e
...
...
@@ -32,7 +32,30 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
binPath
=
self
.
getPath
()
os
.
system
(
"rm -f rest_query_specified-0 rest_query_super-0 taosc_query_specified-0 taosc_query_super-0"
)
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"create database if not exists db"
)
...
...
@@ -41,7 +64,7 @@ class TDTestCase:
tdSql
.
execute
(
"insert into stb_0 using stb tags (0) values (now, 0)"
)
tdSql
.
execute
(
"insert into stb_1 using stb tags (1) values (now, 1)"
)
tdSql
.
execute
(
"insert into stb_2 using stb tags (2) values (now, 2)"
)
cmd
=
"
taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_query.json"
cmd
=
"
%s -f ./5-taos-tools/taosbenchmark/json/taosc_query.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
with
open
(
"%s"
%
"taosc_query_specified-0"
,
'r+'
)
as
f1
:
...
...
@@ -54,7 +77,7 @@ class TDTestCase:
queryTaosc
=
line
.
strip
().
split
()[
0
]
assert
queryTaosc
==
'1'
,
"result is %s != expect: 1"
%
queryTaosc
cmd
=
"
taosBenchmark -f ./5-taos-tools/taosbenchmark/json/rest_query.json"
cmd
=
"
%s -f ./5-taos-tools/taosbenchmark/json/rest_query.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/sample_csv_json.py
浏览文件 @
d10cce1e
...
...
@@ -28,8 +28,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -f ./5-taos-tools/taosbenchmark/json/taosc_sample_use_ts.json"
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/taosc_sample_use_ts.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/sml_interlace.py
浏览文件 @
d10cce1e
...
...
@@ -28,8 +28,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_interlace.json"
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/sml_interlace.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/sml_json_alltypes.py
浏览文件 @
d10cce1e
...
...
@@ -28,8 +28,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_json_alltypes.json"
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/sml_json_alltypes.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/sml_telnet_alltypes.py
浏览文件 @
d10cce1e
...
...
@@ -28,8 +28,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_telnet_alltypes.json"
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/sml_telnet_alltypes.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/subscripe_json.py
浏览文件 @
d10cce1e
...
...
@@ -28,7 +28,30 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
binPath
=
self
.
getPath
()
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"create database if not exists db"
)
tdSql
.
execute
(
"use db"
)
...
...
@@ -36,11 +59,11 @@ class TDTestCase:
tdSql
.
execute
(
"insert into stb_0 using stb tags (0) values (now, 0)"
)
tdSql
.
execute
(
"insert into stb_1 using stb tags (1) values (now, 1)"
)
tdSql
.
execute
(
"insert into stb_2 using stb tags (2) values (now, 2)"
)
cmd
=
"
taosBenchmark -f ./5-taos-tools/taosbenchmark/json/specified_subscribe.json -g"
cmd
=
"
%s -f ./5-taos-tools/taosbenchmark/json/specified_subscribe.json -g"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
assert
os
.
system
(
"%s"
%
cmd
)
==
0
cmd
=
"
taosBenchmark -f ./5-taos-tools/taosbenchmark/json/super_subscribe.json -g"
cmd
=
"
%s -f ./5-taos-tools/taosbenchmark/json/super_subscribe.json -g"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
assert
os
.
system
(
"%s"
%
cmd
)
==
0
...
...
tests/develop-test/5-taos-tools/taosbenchmark/taosadapter_json.py
浏览文件 @
d10cce1e
...
...
@@ -28,8 +28,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_rest_telnet.json"
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/sml_rest_telnet.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
@@ -42,7 +65,7 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from db.stb2"
)
tdSql
.
checkData
(
0
,
0
,
160
)
cmd
=
"
taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_rest_line.json"
cmd
=
"
%s -f ./5-taos-tools/taosbenchmark/json/sml_rest_line.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
@@ -55,7 +78,7 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from db2.stb2"
)
tdSql
.
checkData
(
0
,
0
,
160
)
cmd
=
"
taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_rest_json.json"
cmd
=
"
%s -f ./5-taos-tools/taosbenchmark/json/sml_rest_json.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
tdSql
.
execute
(
"reset query cache"
)
...
...
tests/develop-test/5-taos-tools/taosbenchmark/telnet_tcp.py
浏览文件 @
d10cce1e
...
...
@@ -29,8 +29,31 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
):
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
run
(
self
):
cmd
=
"taosBenchmark -f ./5-taos-tools/taosbenchmark/json/sml_telnet_tcp.json"
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/sml_telnet_tcp.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
time
.
sleep
(
5
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录