Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
58e23b52
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看板
提交
58e23b52
编写于
12月 29, 2020
作者:
P
Ping Xiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-2551]<test>: get insert delay values for taosdemo performance
上级
f4f5d77e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
6 deletion
+38
-6
tests/perftest-scripts/perftest-query.sh
tests/perftest-scripts/perftest-query.sh
+7
-1
tests/pytest/tools/taosdemoPerformance.py
tests/pytest/tools/taosdemoPerformance.py
+31
-5
未找到文件。
tests/perftest-scripts/perftest-query.sh
浏览文件 @
58e23b52
...
...
@@ -74,8 +74,14 @@ function runQueryPerfTest {
CREATETABLETIME
=
`
grep
'Spent'
taosdemoperf.txt |
awk
'NR==1{print $2}'
`
INSERTRECORDSTIME
=
`
grep
'Spent'
taosdemoperf.txt |
awk
'NR==2{print $2}'
`
REQUESTSPERSECOND
=
`
grep
'Spent'
taosdemoperf.txt |
awk
'NR==2{print $13}'
`
delay
=
`
grep
'delay'
taosdemoperf.txt |
awk
'{print $4}'
`
AVGDELAY
=
`
echo
${
delay
:0:
${#
delay
}
-3
}
`
delay
=
`
grep
'delay'
taosdemoperf.txt |
awk
'{print $6}'
`
MAXDELAY
=
`
echo
${
delay
:0:
${#
delay
}
-3
}
`
delay
=
`
grep
'delay'
taosdemoperf.txt |
awk
'{print $8}'
`
MINDELAY
=
`
echo
${
delay
:0:
${#
delay
}
-2
}
`
python3 tools/taosdemoPerformance.py
-c
$LOCAL_COMMIT
-t
$CREATETABLETIME
-i
$INSERTRECORDSTIME
-r
$REQUESTSPERSECOND
|
tee
-a
$PERFORMANCE_TEST_REPORT
python3 tools/taosdemoPerformance.py
-c
$LOCAL_COMMIT
-t
$CREATETABLETIME
-i
$INSERTRECORDSTIME
-r
$REQUESTSPERSECOND
-avg
$AVGDELAY
-max
$MAXDELAY
-min
$MINDELAY
|
tee
-a
$PERFORMANCE_TEST_REPORT
[
-f
taosdemoperf.txt
]
&&
rm
taosdemoperf.txt
}
...
...
tests/pytest/tools/taosdemoPerformance.py
浏览文件 @
58e23b52
...
...
@@ -22,12 +22,15 @@ import argparse
import
os.path
class
taosdemoPerformace
:
def
__init__
(
self
,
commitID
,
dbName
,
createTableTime
,
insertRecordsTime
,
recordsPerSecond
):
def
__init__
(
self
,
commitID
,
dbName
,
createTableTime
,
insertRecordsTime
,
recordsPerSecond
,
avgDelay
,
maxDelay
,
minDelay
):
self
.
commitID
=
commitID
self
.
dbName
=
dbName
self
.
createTableTime
=
createTableTime
self
.
insertRecordsTime
=
insertRecordsTime
self
.
recordsPerSecond
=
recordsPerSecond
self
.
recordsPerSecond
=
recordsPerSecond
self
.
avgDelay
=
avgDelay
self
.
maxDelay
=
maxDelay
self
.
minDelay
=
minDelay
self
.
host
=
"127.0.0.1"
self
.
user
=
"root"
self
.
password
=
"taosdata"
...
...
@@ -43,12 +46,15 @@ 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))"
)
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
)"
)
print
(
"==================== taosdemo performance ===================="
)
print
(
"create tables time: %f"
%
self
.
createTableTime
)
print
(
"insert records time: %f"
%
self
.
insertRecordsTime
)
print
(
"records per second: %f"
%
self
.
recordsPerSecond
)
cursor
.
execute
(
"insert into taosdemo_perf values(now, %f, %f, %f, '%s')"
%
(
self
.
createTableTime
,
self
.
insertRecordsTime
,
self
.
recordsPerSecond
,
self
.
commitID
))
print
(
"avg delay: %f"
%
self
.
avgDelay
)
print
(
"max delay: %f"
%
self
.
maxDelay
)
print
(
"min delay: %f"
%
self
.
minDelay
)
cursor
.
execute
(
"insert into taosdemo_perf values(now, %f, %f, %f, '%s', %f, %f, %f)"
%
(
self
.
createTableTime
,
self
.
insertRecordsTime
,
self
.
recordsPerSecond
,
self
.
commitID
,
self
.
avgDelay
,
self
.
maxDelay
,
self
.
minDelay
))
cursor
.
execute
(
"drop database if exists taosdemo_insert_test"
)
cursor
.
close
()
...
...
@@ -86,8 +92,28 @@ if __name__ == '__main__':
action
=
'store'
,
type
=
float
,
help
=
'records per request'
)
parser
.
add_argument
(
'-avg'
,
'---avg-delay'
,
action
=
'store'
,
type
=
float
,
help
=
'avg delay'
)
parser
.
add_argument
(
'-max'
,
'---max-delay'
,
action
=
'store'
,
type
=
float
,
help
=
'max delay'
)
parser
.
add_argument
(
'-min'
,
'---min-delay'
,
action
=
'store'
,
type
=
float
,
help
=
'min delay'
)
args
=
parser
.
parse_args
()
perftest
=
taosdemoPerformace
(
args
.
commit_id
,
args
.
database_name
,
args
.
create_table
,
args
.
insert_records
,
args
.
records_per_second
)
perftest
=
taosdemoPerformace
(
args
.
commit_id
,
args
.
database_name
,
args
.
create_table
,
args
.
insert_records
,
args
.
records_per_second
,
args
.
avg_delay
,
args
.
max_delay
,
args
.
min_delay
)
perftest
.
createTablesAndStoreData
()
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录