Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
24734ab1
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看板
未验证
提交
24734ab1
编写于
12月 02, 2020
作者:
H
huili
提交者:
GitHub
12月 02, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4402 from taosdata/test/testcase
[TD-2178]<test>add table per batch
上级
46816233
bd6e5f2c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
47 addition
and
23 deletion
+47
-23
Jenkinsfile
Jenkinsfile
+41
-1
tests/pytest/insert/restfulInsert.py
tests/pytest/insert/restfulInsert.py
+6
-22
未找到文件。
Jenkinsfile
浏览文件 @
24734ab1
...
...
@@ -175,7 +175,47 @@ pipeline {
}
}
stage
(
'arm64_build'
){
agent
{
label
'arm64'
}
steps
{
sh
'''
cd ${WK}
git fetch
git checkout develop
git pull
cd ${WKC}
git fetch
git checkout develop
git pull
git submodule update
cd ${WKC}/packaging
./release.sh -v cluster -c aarch64 -n 2.0.0.0 -m 2.0.0.0
'''
}
}
stage
(
'arm32_build'
){
agent
{
label
'arm32'
}
steps
{
catchError
(
buildResult:
'SUCCESS'
,
stageResult:
'FAILURE'
)
{
sh
'''
cd ${WK}
git fetch
git checkout develop
git pull
cd ${WKC}
git fetch
git checkout develop
git pull
git submodule update
cd ${WKC}/packaging
./release.sh -v cluster -c aarch32 -n 2.0.0.0 -m 2.0.0.0
'''
}
}
}
}
}
...
...
tests/pytest/insert/restfulInsert.py
浏览文件 @
24734ab1
...
...
@@ -44,22 +44,9 @@ class RestfulInsert:
if
response
.
status_code
!=
200
:
print
(
response
.
content
)
def
insertData
(
self
,
threadID
):
print
(
"thread %d started"
%
threadID
)
tablesPerThread
=
int
(
self
.
numOfTables
/
self
.
numOfThreads
)
for
i
in
range
(
tablesPerThread
):
tableID
=
i
+
threadID
*
tablesPerThread
start
=
self
.
ts
for
j
in
range
(
int
(
self
.
recordsPerTable
/
self
.
batchSize
)):
data
=
"insert into %s.%s%d values"
%
(
self
.
dbname
,
self
.
tableNamePerfix
,
tableID
)
values
=
[]
for
k
in
range
(
self
.
batchSize
):
data
+=
"(%d, %d, %d, %d)"
%
(
start
+
j
*
self
.
batchSize
+
k
,
random
.
randint
(
1
,
100
),
random
.
randint
(
1
,
100
),
random
.
randint
(
1
,
100
))
response
=
requests
.
post
(
self
.
url
,
data
,
headers
=
self
.
header
)
if
response
.
status_code
!=
200
:
print
(
response
.
content
)
def
insert
n
Data
(
self
,
threadID
):
def
insertData
(
self
,
threadID
):
print
(
"thread %d started"
%
threadID
)
tablesPerThread
=
int
(
self
.
numOfTables
/
self
.
numOfThreads
)
loop
=
int
(
self
.
recordsPerTable
/
self
.
batchSize
)
...
...
@@ -81,11 +68,9 @@ class RestfulInsert:
if
self
.
outOfOrder
:
random
.
shuffle
(
values
)
data
+=
''
.
join
(
values
)
response
=
requests
.
post
(
self
.
url
,
data
,
headers
=
self
.
header
)
if
response
.
status_code
!=
200
:
print
(
response
.
content
)
print
(
'----------------'
,
loop
,
time
.
time
()
-
start1
)
else
:
for
i
in
range
(
0
,
tablesPerThread
+
self
.
tablePerbatch
,
self
.
tablePerbatch
):
for
k
in
range
(
loop
):
...
...
@@ -101,8 +86,7 @@ class RestfulInsert:
values
.
append
(
"(%d, %d, %d, %d)"
%
(
start
+
k
*
self
.
batchSize
+
l
,
random
.
randint
(
1
,
100
),
random
.
randint
(
1
,
100
),
random
.
randint
(
1
,
100
)))
if
self
.
outOfOrder
:
random
.
shuffle
(
values
)
data
+=
''
.
join
(
values
)
print
(
'------------------'
,
len
(
data
))
data
+=
''
.
join
(
values
)
if
len
(
data
)
>
1024
*
1024
:
print
(
'batch size is larger than 1M'
)
exit
(
-
1
)
...
...
@@ -169,7 +153,7 @@ class RestfulInsert:
for
i
in
range
(
self
.
numOfThreads
):
threads
[
i
].
join
()
print
(
"inserting %
d
records takes %d seconds"
%
(
self
.
numOfTables
*
self
.
recordsPerTable
,
(
time
.
time
()
-
startTime
)))
print
(
"inserting %
s
records takes %d seconds"
%
(
self
.
numOfTables
*
self
.
recordsPerTable
,
(
time
.
time
()
-
startTime
)))
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
...
...
@@ -204,14 +188,14 @@ parser.add_argument(
'-T'
,
'--number-of-tables'
,
action
=
'store'
,
default
=
1000
,
default
=
1000
0
,
type
=
int
,
help
=
'Number of tables to be created (default: 1000)'
)
parser
.
add_argument
(
'-r'
,
'--number-of-records'
,
action
=
'store'
,
default
=
1000
,
default
=
1000
0
,
type
=
int
,
help
=
'Number of record to be created for each table (default: 1000, -1 for unlimited records)'
)
parser
.
add_argument
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录