Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bc2181f4
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
bc2181f4
编写于
8月 11, 2021
作者:
P
Ping Xiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5835]<test>: update performance test script
上级
3dce4c46
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
53 addition
and
9 deletion
+53
-9
tests/pytest/tools/taosdemoPerformance.py
tests/pytest/tools/taosdemoPerformance.py
+53
-9
未找到文件。
tests/pytest/tools/taosdemoPerformance.py
浏览文件 @
bc2181f4
...
...
@@ -19,11 +19,16 @@ import json
import
sys
class
taosdemoPerformace
:
def
__init__
(
self
,
commitID
,
dbName
,
branch
,
type
):
def
__init__
(
self
,
commitID
,
dbName
,
branch
,
type
,
numOfTables
,
numOfRows
,
numOfInt
,
numOfDouble
,
numOfBinary
):
self
.
commitID
=
commitID
self
.
dbName
=
dbName
self
.
branch
=
branch
self
.
type
=
type
self
.
numOfTables
=
numOfTables
self
.
numOfRows
=
numOfRows
self
.
numOfInt
=
numOfInt
self
.
numOfDouble
=
numOfDouble
self
.
numOfBinary
=
numOfBinary
self
.
host
=
"127.0.0.1"
self
.
user
=
"root"
self
.
password
=
"taosdata"
...
...
@@ -51,13 +56,13 @@ class taosdemoPerformace:
stb
=
{
"name"
:
"meters"
,
"child_table_exists"
:
"no"
,
"childtable_count"
:
10000
,
"childtable_count"
:
self
.
numOfTables
,
"childtable_prefix"
:
"stb_"
,
"auto_create_table"
:
"no"
,
"data_source"
:
"rand"
,
"batch_create_tbl_num"
:
10
,
"insert_mode"
:
"taosc"
,
"insert_rows"
:
100000
,
"insert_rows"
:
self
.
numOfRows
,
"interlace_rows"
:
100
,
"max_sql_len"
:
1024000
,
"disorder_ratio"
:
0
,
...
...
@@ -68,7 +73,9 @@ class taosdemoPerformace:
"sample_file"
:
"./sample.csv"
,
"tags_file"
:
""
,
"columns"
:
[
{
"type"
:
"INT"
,
"count"
:
4
}
{
"type"
:
"INT"
,
"count"
:
self
.
numOfInt
},
{
"type"
:
"DOUBLE"
,
"count"
:
self
.
numOfDouble
},
{
"type"
:
"BINARY"
,
"len"
:
128
,
"count"
:
self
.
numOfBinary
}
],
"tags"
:
[
{
"type"
:
"INT"
,
"count"
:
1
},
...
...
@@ -76,6 +83,7 @@ class taosdemoPerformace:
]
}
stables
=
[]
stables
.
append
(
stb
)
...
...
@@ -163,7 +171,7 @@ class taosdemoPerformace:
cursor
.
execute
(
"create database if not exists %s"
%
self
.
dbName
)
cursor
.
execute
(
"use %s"
%
self
.
dbName
)
cursor
.
execute
(
"create table if not exists taosdemo_perf (ts timestamp, create_table_time float, insert_records_time float, records_per_second float, commit_id binary(50), avg_delay float, max_delay float, min_delay float, branch binary(50), type binary(20))"
)
cursor
.
execute
(
"create table if not exists taosdemo_perf (ts timestamp, create_table_time float, insert_records_time float, records_per_second float, commit_id binary(50), avg_delay float, max_delay float, min_delay float, branch binary(50), type binary(20)
, numoftables int, numofrows int, numofint int, numofdouble int, numofbinary int
)"
)
print
(
"==================== taosdemo performance ===================="
)
print
(
"create tables time: %f"
%
float
(
self
.
createTableTime
))
print
(
"insert records time: %f"
%
float
(
self
.
insertRecordsTime
))
...
...
@@ -171,13 +179,14 @@ class taosdemoPerformace:
print
(
"avg delay: %f"
%
float
(
self
.
avgDelay
))
print
(
"max delay: %f"
%
float
(
self
.
maxDelay
))
print
(
"min delay: %f"
%
float
(
self
.
minDelay
))
cursor
.
execute
(
"insert into taosdemo_perf values(now, %f, %f, %f, '%s', %f, %f, %f, '%s', '%s')"
%
cursor
.
execute
(
"insert into taosdemo_perf values(now, %f, %f, %f, '%s', %f, %f, %f, '%s', '%s'
, %d, %d, %d, %d, %d
)"
%
(
float
(
self
.
createTableTime
),
float
(
self
.
insertRecordsTime
),
float
(
self
.
recordsPerSecond
),
self
.
commitID
,
float
(
self
.
avgDelay
),
float
(
self
.
maxDelay
),
float
(
self
.
minDelay
),
self
.
branch
,
self
.
type
))
self
.
commitID
,
float
(
self
.
avgDelay
),
float
(
self
.
maxDelay
),
float
(
self
.
minDelay
),
self
.
branch
,
self
.
type
,
self
.
numOfTables
,
self
.
numOfRows
,
self
.
numOfInt
,
self
.
numOfDouble
,
self
.
numOfBinary
))
cursor
.
close
()
cursor1
=
self
.
conn
.
cursor
()
cursor1
.
execute
(
"drop database if exists %s"
%
self
.
insertDB
)
#
cursor1.execute("drop database if exists %s" % self.insertDB)
cursor1
.
close
()
if
__name__
==
'__main__'
:
...
...
@@ -209,8 +218,43 @@ if __name__ == '__main__':
default
=
'glibc'
,
type
=
str
,
help
=
'build type (default: glibc)'
)
parser
.
add_argument
(
'-i'
,
'--num-of-int'
,
action
=
'store'
,
default
=
4
,
type
=
int
,
help
=
'num of int columns (default: 4)'
)
parser
.
add_argument
(
'-D'
,
'--num-of-double'
,
action
=
'store'
,
default
=
0
,
type
=
int
,
help
=
'num of double columns (default: 4)'
)
parser
.
add_argument
(
'-B'
,
'--num-of-binary'
,
action
=
'store'
,
default
=
0
,
type
=
int
,
help
=
'num of binary columns (default: 4)'
)
parser
.
add_argument
(
'-t'
,
'--num-of-tables'
,
action
=
'store'
,
default
=
10000
,
type
=
int
,
help
=
'num of tables (default: 10000)'
)
parser
.
add_argument
(
'-r'
,
'--num-of-rows'
,
action
=
'store'
,
default
=
100000
,
type
=
int
,
help
=
'num of rows (default: 100000)'
)
args
=
parser
.
parse_args
()
perftest
=
taosdemoPerformace
(
args
.
commit_id
,
args
.
database_name
,
args
.
git_branch
,
args
.
build_type
)
perftest
=
taosdemoPerformace
(
args
.
commit_id
,
args
.
database_name
,
args
.
git_branch
,
args
.
build_type
,
args
.
num_of_tables
,
args
.
num_of_rows
,
args
.
num_of_int
,
args
.
num_of_double
,
args
.
num_of_binary
)
perftest
.
insertData
()
perftest
.
createTablesAndStoreData
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录