Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Board update and libs #69

Merged
merged 4 commits into from
Oct 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ The supported versions:
* Java 11 - make sure that you have it (its minimum version).
* InfluxDB v2.x, see release notes: https://docs.influxdata.com/influxdb/v2.0/reference/release-notes/influxdb/ (1.8 is not supported)
* JMeter 5.5.0 only.
* The current board and plugin were tested on Grafana 8.5.4 and InfluxDB 2.2.0, JAVA 15.

* The current board and plugin were tested on Grafana 9.1.6 and InfluxDB 2.2.0, JAVA 15.

## Maven Support
Please see the latest release here https://search.maven.org/artifact/io.github.mderevyankoaqa/jmeter-plugins-influxdb2-listener.
Expand Down Expand Up @@ -192,9 +193,14 @@ Notes: when test has been interrupted from UI; the processes may not be finished
See deployment instructions here https://grafana.com/grafana/dashboards/13644

Dashboard helps:
* Filter the results by Run Id or Type (can be requests or transactions).
![](img/filterById.png)

![](img/filterByType.png)


* Monitor throughput with active users.
![](img/grafana1.png)


* Overview and analise the response time, distribution as well. Added the filters to see requests with status "pass", "fail".
![](img/grafana2.png)
Expand Down
11 changes: 9 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repositories {

sourceCompatibility = 11
group = 'io.github.mderevyankoaqa'
version = '2.4'
version = '2.5'
def title = 'JMeterInfluxDB2Listener'
def archiveName = 'jmeter-plugins-influxdb2-listener'

Expand All @@ -45,15 +45,17 @@ def archiveName = 'jmeter-plugins-influxdb2-listener'
implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_java', version: '5.5'
implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_components', version: '5.5'
implementation group: 'org.apache.jmeter', name: 'jorphan', version: '5.5'
implementation group: 'com.influxdb', name: 'influxdb-client-java', version: '6.1.0'
implementation group: 'com.influxdb', name: 'influxdb-client-java', version: '6.5.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_http', version: '5.4.3'

components {
withModule("org.apache.jmeter:ApacheJMeter_core", JMeterRule)
withModule("org.apache.jmeter:ApacheJMeter_java", JMeterRule)
withModule("org.apache.jmeter:ApacheJMeter_components", JMeterRule)
withModule("org.apache.jmeter:jorphan", JMeterRule)
withModule("org.apache.jmeter:ApacheJMeter", JMeterRule)
withModule("org.apache.jmeter:ApacheJMeter_http", JMeterRule)
}
}

Expand Down Expand Up @@ -130,6 +132,11 @@ publishing {
name = 'Pierre Brun'
email = 'pbrun.pro@gmail.com'
}
developer {
id = 'ushklianik'
name = 'Uladzislau Shklianik'
email = 'Uladzislau_Shklianik@epam.com'
}
}
scm {
connection = 'scm:git:git:github.com/mderevyankoaqa/jmeter-influxdb2-listener-plugin.git'
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Fri Apr 17 22:39:55 EEST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
Binary file added img/filterById.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/filterByType.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.github.mderevyankoaqa.influxdb2.visualizer.result.SampleResultPointContext;
import io.github.mderevyankoaqa.influxdb2.visualizer.result.SampleResultPointProvider;
import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.protocol.http.sampler.HTTPSampleResult;
import org.apache.jmeter.samplers.SampleResult;
import org.apache.jmeter.threads.JMeterContextService;
import org.apache.jmeter.threads.JMeterContextService.ThreadCounts;
Expand Down Expand Up @@ -124,6 +125,11 @@ public void handleSampleResults(List<SampleResult> sampleResults, BackendListene

for (SampleResult sampleResult : allSampleResults) {
getUserMetrics().add(sampleResult);
// Determine the type of sample, whether it is a request or a transaction controller
String samplerType = "transaction";
if (sampleResult instanceof HTTPSampleResult){
samplerType = "request";
}

if ((null != regexForSamplerList && sampleResult.getSampleLabel().matches(regexForSamplerList))
|| samplersToFilter.contains(sampleResult.getSampleLabel())) {
Expand All @@ -133,6 +139,7 @@ public void handleSampleResults(List<SampleResult> sampleResults, BackendListene
sampleResultContext.setTestName(this.testName);
sampleResultContext.setNodeName(this.nodeName);
sampleResultContext.setSampleResult(sampleResult);
sampleResultContext.setSamplerType(samplerType);
sampleResultContext.setTimeToSet(System.currentTimeMillis() * ONE_MS_IN_NANOSECONDS + this.getUniqueNumberForTheSamplerThread());
sampleResultContext.setErrorBodyToBeSaved(context.getBooleanParameter(KEY_INCLUDE_BODY_OF_FAILURES, false));
sampleResultContext.setResponseBodyLength(this.influxDBConfig.getResponseBodyLength());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ interface Tags {
* The result, can be pass or fail.
*/
String RESULT = "result";

/**
* sampleType represents the type of sample, whether it is a request or a transaction controller.
*/
String SAMPLE_TYPE = "samplerType";
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class SampleResultPointContext {
private String testName;
boolean errorBodyToBeSaved;
private int ResponseBodyLength;
private String samplerType;

/**
* Checks whether the body of the failed repose is going to be saved.
Expand Down Expand Up @@ -127,4 +128,20 @@ public int getResponseBodyLength() {
public void setResponseBodyLength(int responseBodyLength) {
this.ResponseBodyLength = responseBodyLength;
}

/**
* Sets samplerType.
* @param samplerType represents the type of sample, whether it is a request or a transaction controller.
*/
public void setSamplerType(String samplerType) {
this.samplerType = samplerType;
}

/**
* Gets the SamplerType.
* @return returns SamplerType.
*/
public String getSamplerType() {
return this.samplerType;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ private Point getDefaultPoint() {
.addTag(RequestMeasurement.Tags.NODE_NAME, this.sampleResultContext.getNodeName())
.addTag(RequestMeasurement.Tags.RESULT_CODE, this.sampleResultContext.getSampleResult().getResponseCode())
.addTag(RequestMeasurement.Tags.ERROR_MSG, this.getAssertionFailure())
.addTag(RequestMeasurement.Tags.SAMPLE_TYPE, this.sampleResultContext.getSamplerType())
.addTag(RequestMeasurement.Tags.ERROR_RESPONSE_BODY, this.getErrorBodyToBeSaved(this.sampleResultContext.isErrorBodyToBeSaved()))
.addField(RequestMeasurement.Fields.ERROR_COUNT, this.sampleResultContext.getSampleResult().getErrorCount())
.addField(RequestMeasurement.Fields.REQUEST_COUNT, this.sampleResultContext.getSampleResult().getSampleCount())
Expand Down