jmeter report type

This commit is contained in:
Captain.B 2020-03-20 17:14:49 +08:00
parent 48a620c9cd
commit 1210d4c8c3
3 changed files with 81 additions and 0 deletions

View File

@ -152,6 +152,24 @@
<artifactId>jmeter-plugins-casutg</artifactId>
<version>2.9</version>
</dependency>
<!-- jmeter graph -->
<dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-cmd</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-synthesis</artifactId>
<version>2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/kg.apc/jmeter-plugins-standard -->
<dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-standard</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>

View File

@ -0,0 +1,22 @@
package io.metersphere.commons.constants;
public enum JmeterReportType {
AggregateReport,
SynthesisReport,
ThreadsStateOverTime,
BytesThroughputOverTime,
HitsPerSecond,
LatenciesOverTime,
PerfMon,
DbMon,
JMXMon,
ResponseCodesPerSecond,
ResponseTimesDistribution,
ResponseTimesOverTime,
ResponseTimesPercentiles,
ThroughputVsThreads,
TimesVsThreads,
TransactionsPerSecond,
PageDataExtractorOverTime,
MergeResults,
}

View File

@ -0,0 +1,41 @@
package io.metersphere;
import io.metersphere.commons.constants.JmeterReportType;
import kg.apc.jmeter.PluginsCMDWorker;
import org.apache.jmeter.util.JMeterUtils;
import org.junit.Test;
public class GenerateGraphTest {
/*
AggregateReport = JMeter's native Aggregate Report, can be saved only as CSV
SynthesisReport = mix between JMeter's native Summary Report and Aggregate Report, can be saved only as CSV
ThreadsStateOverTime = Active Threads Over Time
BytesThroughputOverTime
HitsPerSecond
LatenciesOverTime
PerfMon = PerfMon Metrics Collector
DbMon = DbMon Metrics Collector, DataBase, get performance counters via sql
JMXMon = JMXMon Metrics Collector, Java Management Extensions counters
ResponseCodesPerSecond
ResponseTimesDistribution
ResponseTimesOverTime
ResponseTimesPercentiles
ThroughputVsThreads
TimesVsThreads = Response Times VS Threads
TransactionsPerSecond
PageDataExtractorOverTime
MergeResults = MergeResults Command Line Merge Tool to simplify the comparison of two or more load tests, need properties file (like merge-results.properties)
*/
@Test
public void test1() {
JMeterUtils.setJMeterHome("/opt/fit2cloud/apache-jmeter-5.2.1");
JMeterUtils.loadJMeterProperties("/opt/fit2cloud/apache-jmeter-5.2.1/bin/jmeter.properties");
PluginsCMDWorker worker = new PluginsCMDWorker();
worker.setPluginType(JmeterReportType.AggregateReport.name());
worker.addExportMode(2);
worker.setOutputCSVFile("/tmp/test0320.csv");
worker.setInputFile("/Users/liuruibin/Desktop/0316.jtl");
worker.doJob();
}
}