reporting
This commit is contained in:
parent
7d99ac3e8b
commit
cebfba849e
|
@ -1,5 +1,5 @@
|
|||
package io.metersphere.commons.constants;
|
||||
|
||||
public enum PerformanceTestStatus {
|
||||
Saved, Starting, Running, Completed, Error
|
||||
Saved, Starting, Running, Reporting, Completed, Error
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package io.metersphere.service;
|
||||
|
||||
import io.metersphere.base.domain.*;
|
||||
import io.metersphere.base.domain.LoadTestReport;
|
||||
import io.metersphere.base.domain.LoadTestReportExample;
|
||||
import io.metersphere.base.domain.LoadTestReportWithBLOBs;
|
||||
import io.metersphere.base.domain.LoadTestWithBLOBs;
|
||||
import io.metersphere.base.mapper.LoadTestMapper;
|
||||
import io.metersphere.base.mapper.LoadTestReportMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtLoadTestReportMapper;
|
||||
|
@ -16,6 +19,7 @@ import io.metersphere.report.base.*;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -139,6 +143,8 @@ public class ReportService {
|
|||
String reportStatus = loadTestReport.getStatus();
|
||||
if (StringUtils.equals(PerformanceTestStatus.Running.name(), reportStatus)) {
|
||||
MSException.throwException("Reporting in progress...");
|
||||
} else if (StringUtils.equals(PerformanceTestStatus.Reporting.name(), reportStatus)) {
|
||||
MSException.throwException("Reporting in progress...");
|
||||
} else if (StringUtils.equals(PerformanceTestStatus.Error.name(), reportStatus)) {
|
||||
MSException.throwException("Report generation error!");
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package io.metersphere;
|
||||
|
||||
import io.metersphere.config.KafkaProperties;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -22,6 +23,7 @@ import javax.xml.transform.stream.StreamResult;
|
|||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.StringWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
|
@ -47,7 +49,7 @@ public class JmxFileParseTest {
|
|||
@Test
|
||||
public void parse() throws Exception {
|
||||
File file = new File("/Users/liuruibin/Downloads/blaze_meter_dev2.jmx");
|
||||
file = new File("/Users/liuruibin/Desktop/test-jmeter.jmx");
|
||||
file = new File("/Users/liuruibin/Desktop/041301.jmx");
|
||||
|
||||
final FileInputStream inputStream = new FileInputStream(file);
|
||||
final InputSource inputSource = new InputSource(inputStream);
|
||||
|
@ -78,7 +80,8 @@ public class JmxFileParseTest {
|
|||
TransformerFactory tf = TransformerFactory.newInstance();
|
||||
Transformer transformer = tf.newTransformer();
|
||||
transformer.transform(domSource, result);
|
||||
System.out.println("XML IN String format is: \n" + writer.toString());
|
||||
// System.out.println("XML IN String format is: \n" + writer.toString());
|
||||
FileUtils.writeStringToFile(new File("/tmp/test-jmeter.jmx"), writer.toString(), StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
private void parseHashTree(Element hashTree) {
|
||||
|
@ -112,13 +115,13 @@ public class JmxFileParseTest {
|
|||
} else if (nodeNameEquals(ele, VARIABLE_THROUGHPUT_TIMER)) {
|
||||
|
||||
} else if (nodeNameEquals(ele, BACKEND_LISTENER)) {
|
||||
processBackendListener(ele);
|
||||
// processBackendListener(ele);
|
||||
} else if (nodeNameEquals(ele, CONFIG_TEST_ELEMENT)) {
|
||||
processConfigTestElement(ele);
|
||||
// processConfigTestElement(ele);
|
||||
} else if (nodeNameEquals(ele, DNS_CACHE_MANAGER)) {
|
||||
processDnsCacheManager(ele);
|
||||
// processDnsCacheManager(ele);
|
||||
} else if (nodeNameEquals(ele, ARGUMENTS)) {
|
||||
processArguments(ele);
|
||||
// processArguments(ele);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,6 +138,7 @@
|
|||
});
|
||||
break;
|
||||
case 'Starting':
|
||||
case 'Reporting':
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: "报告生成中...."
|
||||
|
|
|
@ -53,6 +53,9 @@
|
|||
<el-tag size="mini" type="success" v-else-if="row.status === 'Running'">
|
||||
{{ row.status }}
|
||||
</el-tag>
|
||||
<el-tag size="mini" type="success" v-else-if="row.status === 'Reporting'">
|
||||
{{ row.status }}
|
||||
</el-tag>
|
||||
<el-tag size="mini" type="info" v-else-if="row.status === 'Completed'">
|
||||
{{ row.status }}
|
||||
</el-tag>
|
||||
|
|
|
@ -55,6 +55,9 @@
|
|||
<el-tag size="mini" type="success" v-else-if="row.status === 'Running'">
|
||||
{{ row.status }}
|
||||
</el-tag>
|
||||
<el-tag size="mini" type="success" v-else-if="row.status === 'Reporting'">
|
||||
{{ row.status }}
|
||||
</el-tag>
|
||||
<el-tag size="mini" type="info" v-else-if="row.status === 'Completed'">
|
||||
{{ row.status }}
|
||||
</el-tag>
|
||||
|
|
Loading…
Reference in New Issue