From a281f084226d084875f5975ebba45d8eaa84e4c1 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Fri, 5 Mar 2021 16:43:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E7=BA=BF=E7=A8=8B=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../performance/engine/EngineFactory.java | 9 ---- .../xml/reader/jmx/JmeterDocumentParser.java | 14 ++--- .../components/PerformancePressureConfig.vue | 52 ++++++++++++------- 3 files changed, 40 insertions(+), 35 deletions(-) diff --git a/backend/src/main/java/io/metersphere/performance/engine/EngineFactory.java b/backend/src/main/java/io/metersphere/performance/engine/EngineFactory.java index 454e7c16c8..1dc094a0ca 100644 --- a/backend/src/main/java/io/metersphere/performance/engine/EngineFactory.java +++ b/backend/src/main/java/io/metersphere/performance/engine/EngineFactory.java @@ -110,15 +110,6 @@ public class EngineFactory { final JSONArray jsonArray = JSONObject.parseArray(loadTest.getLoadConfiguration()); for (int i = 0; i < jsonArray.size(); i++) { - if (jsonArray.get(i) instanceof Map) { - JSONObject o = jsonArray.getJSONObject(i); - String key = o.getString("key"); - if ("TargetLevel".equals(key)) { - engineContext.addProperty(key, Math.round(((Integer) o.get("value")) * ratio)); - } else { - engineContext.addProperty(key, o.get("value")); - } - } if (jsonArray.get(i) instanceof List) { JSONArray o = jsonArray.getJSONArray(i); for (int j = 0; j < o.size(); j++) { diff --git a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java index b5c6f04c1f..4a6c2a0998 100644 --- a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java +++ b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java @@ -642,12 +642,12 @@ public class JmeterDocumentParser implements DocumentParser { ((List) rampUps).remove(0); rampUp = o.toString(); } - Object holds = context.getProperty("Hold"); - String hold = "2"; - if (holds instanceof List) { - Object o = ((List) holds).get(0); - ((List) holds).remove(0); - hold = o.toString(); + Object durations = context.getProperty("duration"); + String duration = "2"; + if (durations instanceof List) { + Object o = ((List) durations).get(0); + ((List) durations).remove(0); + duration = o.toString(); } Object deleteds = context.getProperty("deleted"); String deleted = "false"; @@ -681,7 +681,7 @@ public class JmeterDocumentParser implements DocumentParser { threadGroup.appendChild(createStringProp(document, "ThreadGroup.on_sample_error", "continue")); threadGroup.appendChild(createStringProp(document, "ThreadGroup.num_threads", threads)); threadGroup.appendChild(createStringProp(document, "ThreadGroup.ramp_time", rampUp)); - threadGroup.appendChild(createStringProp(document, "ThreadGroup.duration", hold)); + threadGroup.appendChild(createStringProp(document, "ThreadGroup.duration", duration)); threadGroup.appendChild(createStringProp(document, "ThreadGroup.delay", "0")); threadGroup.appendChild(createBoolProp(document, "ThreadGroup.scheduler", true)); threadGroup.appendChild(createBoolProp(document, "ThreadGroup.same_user_on_next_iteration", true)); diff --git a/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue b/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue index f9b594afd1..3a5d5b0c28 100644 --- a/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue +++ b/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue @@ -49,25 +49,39 @@ size="mini"/>
- - - - - - - +
+ + + + + + + +
+ +
+ + + + +
+