Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
4f7768a8
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 3 年多
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4f7768a8
编写于
11月 05, 2020
作者:
C
Captain.B
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(性能测试): 性能测试支持jar
上级
ff601575
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
38 addition
and
10 deletion
+38
-10
backend/src/main/java/io/metersphere/commons/constants/FileType.java
.../main/java/io/metersphere/commons/constants/FileType.java
+1
-1
backend/src/main/java/io/metersphere/performance/engine/EngineContext.java
...java/io/metersphere/performance/engine/EngineContext.java
+10
-0
backend/src/main/java/io/metersphere/performance/engine/EngineFactory.java
...java/io/metersphere/performance/engine/EngineFactory.java
+10
-0
backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java
...tersphere/performance/engine/docker/DockerTestEngine.java
+1
-0
backend/src/main/java/io/metersphere/performance/engine/docker/request/TestRequest.java
...sphere/performance/engine/docker/request/TestRequest.java
+1
-0
docker/jmeter-base/jmeter.properties
docker/jmeter-base/jmeter.properties
+1
-1
frontend/src/business/components/performance/test/components/PerformanceBasicConfig.vue
...ts/performance/test/components/PerformanceBasicConfig.vue
+10
-4
frontend/src/business/components/xpack
frontend/src/business/components/xpack
+1
-1
frontend/src/i18n/en-US.js
frontend/src/i18n/en-US.js
+1
-1
frontend/src/i18n/zh-CN.js
frontend/src/i18n/zh-CN.js
+1
-1
frontend/src/i18n/zh-TW.js
frontend/src/i18n/zh-TW.js
+1
-1
未找到文件。
backend/src/main/java/io/metersphere/commons/constants/FileType.java
浏览文件 @
4f7768a8
...
...
@@ -3,7 +3,7 @@ package io.metersphere.commons.constants;
public
enum
FileType
{
JMX
(
".jmx"
),
CSV
(
".csv"
),
JSON
(
".json"
),
PDF
(
".pdf"
),
JPG
(
".jpg"
),
PNG
(
".png"
),
JPEG
(
".jpeg"
),
DOC
(
".doc"
),
XLSX
(
".xlsx"
),
DOCX
(
".docx"
);
XLSX
(
".xlsx"
),
DOCX
(
".docx"
)
,
JAR
(
".jar"
)
;
// 保存后缀
private
String
suffix
;
...
...
backend/src/main/java/io/metersphere/performance/engine/EngineContext.java
浏览文件 @
4f7768a8
...
...
@@ -17,6 +17,7 @@ public class EngineContext {
private
Map
<
String
,
Object
>
properties
=
new
HashMap
<>();
private
Map
<
String
,
String
>
testData
=
new
HashMap
<>();
private
Map
<
String
,
String
>
env
=
new
HashMap
<>();
private
Map
<
String
,
byte
[]>
testJars
=
new
HashMap
<>();
public
String
getTestId
()
{
return
testId
;
...
...
@@ -126,4 +127,13 @@ public class EngineContext {
public
void
setResourceIndex
(
Integer
resourceIndex
)
{
this
.
resourceIndex
=
resourceIndex
;
}
public
Map
<
String
,
byte
[]>
getTestJars
()
{
return
testJars
;
}
public
void
setTestJars
(
Map
<
String
,
byte
[]>
testJars
)
{
this
.
testJars
=
testJars
;
}
}
backend/src/main/java/io/metersphere/performance/engine/EngineFactory.java
浏览文件 @
4f7768a8
...
...
@@ -63,6 +63,7 @@ public class EngineFactory {
});
List
<
FileMetadata
>
csvFiles
=
fileMetadataList
.
stream
().
filter
(
f
->
StringUtils
.
equalsIgnoreCase
(
f
.
getType
(),
FileType
.
CSV
.
name
())).
collect
(
Collectors
.
toList
());
List
<
FileMetadata
>
jarFiles
=
fileMetadataList
.
stream
().
filter
(
f
->
StringUtils
.
equalsIgnoreCase
(
f
.
getType
(),
FileType
.
JAR
.
name
())).
collect
(
Collectors
.
toList
());
final
FileContent
fileContent
=
fileService
.
getFileContent
(
jmxFile
.
getId
());
if
(
fileContent
==
null
)
{
MSException
.
throwException
(
Translator
.
get
(
"run_load_test_file_content_not_found"
)
+
loadTest
.
getId
());
...
...
@@ -125,6 +126,15 @@ public class EngineFactory {
engineContext
.
setTestData
(
data
);
}
if
(
CollectionUtils
.
isNotEmpty
(
jarFiles
))
{
Map
<
String
,
byte
[]>
data
=
new
HashMap
<>();
jarFiles
.
forEach
(
jf
->
{
FileContent
content
=
fileService
.
getFileContent
(
jf
.
getId
());
data
.
put
(
jf
.
getName
(),
content
.
getFile
());
});
engineContext
.
setTestJars
(
data
);
}
return
engineContext
;
}
...
...
backend/src/main/java/io/metersphere/performance/engine/docker/DockerTestEngine.java
浏览文件 @
4f7768a8
...
...
@@ -83,6 +83,7 @@ public class DockerTestEngine extends AbstractEngine {
testRequest
.
setFileString
(
content
);
testRequest
.
setImage
(
JMETER_IMAGE
);
testRequest
.
setTestData
(
context
.
getTestData
());
testRequest
.
setTestJars
(
context
.
getTestJars
());
testRequest
.
setEnv
(
context
.
getEnv
());
...
...
backend/src/main/java/io/metersphere/performance/engine/docker/request/TestRequest.java
浏览文件 @
4f7768a8
...
...
@@ -14,4 +14,5 @@ public class TestRequest extends BaseRequest {
private
String
image
;
private
Map
<
String
,
String
>
testData
=
new
HashMap
<>();
private
Map
<
String
,
String
>
env
=
new
HashMap
<>();
private
Map
<
String
,
byte
[]>
testJars
=
new
HashMap
<>();
}
docker/jmeter-base/jmeter.properties
浏览文件 @
4f7768a8
...
...
@@ -1215,7 +1215,7 @@ view.results.tree.renderers_order=.RenderAsText,.RenderAsRegexp,.RenderAsBoundar
# All entries will be added to the class path of the system class loader
# and also to the path of the JMeter internal loader.
# Paths with spaces may cause problems for the JVM
#user.classpath=../classes;../lib
user.classpath
=
/test/
# List of directories (separated by ;) that JMeter will search for utility
# and plugin dependency classes.
...
...
frontend/src/business/components/performance/test/components/PerformanceBasicConfig.vue
浏览文件 @
4f7768a8
<
template
>
<div
v-loading=
"result.loading"
>
<el-upload
accept=
".jmx,.csv"
accept=
".jmx,.csv
,.jar
"
drag
action=
""
:limit=
"fileNumLimit"
...
...
@@ -77,7 +77,7 @@ export default {
fileList
:
[],
tableData
:
[],
uploadList
:
[],
fileNumLimit
:
5
,
fileNumLimit
:
10
,
};
},
created
()
{
...
...
@@ -197,7 +197,7 @@ export default {
return
this
.
fileList
;
// 表示修改了已经上传的文件列表
},
validConfig
()
{
let
newJmxNum
=
0
,
oldJmxNum
=
0
,
newCsvNum
=
0
,
oldCsvNum
=
0
;
let
newJmxNum
=
0
,
oldJmxNum
=
0
,
newCsvNum
=
0
,
oldCsvNum
=
0
,
newJarNum
=
0
,
oldJarNum
=
0
;
if
(
this
.
uploadList
.
length
>
0
)
{
this
.
uploadList
.
forEach
(
f
=>
{
if
(
f
.
name
.
toLowerCase
().
endsWith
(
"
.jmx
"
))
{
...
...
@@ -206,6 +206,9 @@ export default {
if
(
f
.
name
.
toLowerCase
().
endsWith
(
"
.csv
"
))
{
newCsvNum
++
;
}
if
(
f
.
name
.
toLowerCase
().
endsWith
(
"
.jar
"
))
{
newJarNum
++
;
}
});
}
if
(
this
.
fileList
.
length
>
0
)
{
...
...
@@ -216,9 +219,12 @@ export default {
if
(
f
.
name
.
toLowerCase
().
endsWith
(
"
.csv
"
))
{
oldCsvNum
++
;
}
if
(
f
.
name
.
toLowerCase
().
endsWith
(
"
.jar
"
))
{
oldJarNum
++
;
}
});
}
if
(
newCsvNum
+
oldCsvNum
>
this
.
fileNumLimit
-
1
)
{
if
(
newCsvNum
+
oldCsvNum
+
newJarNum
+
oldJarNum
>
this
.
fileNumLimit
-
1
)
{
this
.
handleExceed
();
return
false
;
}
...
...
xpack
@
b9091a47
比较
f6f172c6
...
b9091a47
Subproject commit
f6f172c6451d0f9c51f5e3246a66dde9edcd7a5d
Subproject commit
b9091a47b197faef77c72b134b7cf604fe3209f0
frontend/src/i18n/en-US.js
浏览文件 @
4f7768a8
...
...
@@ -397,7 +397,7 @@ export default {
file_status
:
'
File Status
'
,
last_modify_time
:
'
Modify time
'
,
upload_tips
:
'
Drag files here, or <em> click to upload </em>
'
,
upload_type
:
'
Only JMX/CSV files can be uploaded
'
,
upload_type
:
'
Only JMX/CSV
/JAR
files can be uploaded
'
,
related_file_not_found
:
"
No related test file found!
"
,
delete_file_confirm
:
'
Confirm delete file:
'
,
file_size_limit
:
"
The number of files exceeds the limit!
"
,
...
...
frontend/src/i18n/zh-CN.js
浏览文件 @
4f7768a8
...
...
@@ -395,7 +395,7 @@ export default {
file_status
:
'
文件状态
'
,
last_modify_time
:
'
修改时间
'
,
upload_tips
:
'
将文件拖到此处,或<em>点击上传</em>
'
,
upload_type
:
'
只能上传JMX/CSV文件
'
,
upload_type
:
'
只能上传JMX/CSV
/JAR
文件
'
,
related_file_not_found
:
"
未找到关联的测试文件!
"
,
delete_file_confirm
:
'
确认删除文件:
'
,
file_size_limit
:
"
文件个数超出限制!
"
,
...
...
frontend/src/i18n/zh-TW.js
浏览文件 @
4f7768a8
...
...
@@ -397,7 +397,7 @@ export default {
file_status
:
'
文件狀態
'
,
last_modify_time
:
'
修改時間
'
,
upload_tips
:
'
將文件拖到此處,或<em>點擊上傳</em>
'
,
upload_type
:
'
只能上傳JMX/CSV文件
'
,
upload_type
:
'
只能上傳JMX/CSV
/JAR
文件
'
,
related_file_not_found
:
"
未找到關聯的測試文件!
"
,
delete_file_confirm
:
'
確認刪除文件:
'
,
file_size_limit
:
"
文件個數超出限制!
"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录