Skip to content

Commit

Permalink
Support JMeter 5.6.2 and libs update, Bug fixes (#90)
Browse files Browse the repository at this point in the history
* Added logic to save the error body only for failed requests (#81) - Added logic to save the error body only for failed requests

* update dependencies to jmeter 5.6 (#88) - Updated the dependency to support the Jmeter 5.6  and influxdb-client-java 6.9.0

* Updated the versions of libs: JMeter 5.6.2 and influxdb-client-java 6.10.0; Gradle 8.4; com.github.johnrengelman.shadow 8.1.1

---------

Co-authored-by: ushklianik <76432241+ushklianik@users.noreply.github.com>
Co-authored-by: Mateus Santos <38863499+mateusgsan@users.noreply.github.com>
Co-authored-by: Mikhail Derevyanko <c-Mikhail.Derevyanko@skykick.com>
  • Loading branch information
4 people authored Oct 8, 2023
1 parent 97b2d1a commit cb10bc3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ Pay attention on "Sending metrics performance tuning" chapter, see below.
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.
* JMeter 5.6.2 only.

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

## Maven Support
Please see the latest release here https://search.maven.org/artifact/io.github.mderevyankoaqa/jmeter-plugins-influxdb2-listener.
Expand Down
26 changes: 16 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.github.johnrengelman.shadow' version "7.1.2"
id 'com.github.johnrengelman.shadow' version "8.1.1"
id 'java'
id 'java-library'
id 'project-report'
Expand All @@ -24,7 +24,7 @@ repositories {

sourceCompatibility = 11
group = 'io.github.mderevyankoaqa'
version = '2.6'
version = '2.7'

def title = 'JMeterInfluxDB2Listener'
def archiveName = 'jmeter-plugins-influxdb2-listener'
Expand All @@ -42,13 +42,14 @@ def archiveName = 'jmeter-plugins-influxdb2-listener'
}

dependencies {
implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_core', version: '5.5'
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.7.0'
// classpath "com.github.johnrengelman:shadow:8.1.1"
implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_core', version: '5.6.2'
implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_java', version: '5.6.2'
implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_components', version: '5.6.2'
implementation group: 'org.apache.jmeter', name: 'jorphan', version: '5.6.2'
implementation group: 'com.influxdb', name: 'influxdb-client-java', version: '6.10.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_http', version: '5.5'
implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_http', version: '5.6.2'
components {
withModule("org.apache.jmeter:ApacheJMeter_core", JMeterRule)
withModule("org.apache.jmeter:ApacheJMeter_java", JMeterRule)
Expand Down Expand Up @@ -137,11 +138,16 @@ publishing {
name = 'Uladzislau Shklianik'
email = 'Uladzislau_Shklianik@epam.com'
}
i developer {
developer {
id = 'MalshaUdani'
name = 'Malsha Nagahawatta'
email = 'malsha.nagahawatta@gmail.com'
}
developer {
id = 'mateusgsan'
name = 'Mateus G. Santos'
email = 'mateusgsan@gmail.com'
}

}
scm {
Expand Down Expand Up @@ -177,4 +183,4 @@ javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
}
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.5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public Point getPoint() {
* @param isToBeSaved set to true if body need to be saved; otherwise false.
* @return the normalized string if parameter @param isToBeSaved set to true; 'noData' string otherwise.
*/
private String getErrorBodyToBeSaved(boolean isToBeSaved)
private String getErrorBodyToBeSaved(boolean isToBeSaved, boolean isSuccessful)
{
String errorResponseBody;

if (isToBeSaved)
if (isToBeSaved && isSuccessful)
{
errorResponseBody = this.getErrorBody();
}
Expand Down Expand Up @@ -107,7 +107,7 @@ private Point getDefaultPoint() {
.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()))
.addTag(RequestMeasurement.Tags.ERROR_RESPONSE_BODY, this.getErrorBodyToBeSaved(this.sampleResultContext.isErrorBodyToBeSaved(), !this.sampleResultContext.getSampleResult().isSuccessful()))
.addField(RequestMeasurement.Fields.ERROR_COUNT, this.sampleResultContext.getSampleResult().getErrorCount())
.addField(RequestMeasurement.Fields.REQUEST_COUNT, this.sampleResultContext.getSampleResult().getSampleCount())
.addField(RequestMeasurement.Fields.RECEIVED_BYTES, this.sampleResultContext.getSampleResult().getBytesAsLong())
Expand Down

0 comments on commit cb10bc3

Please sign in to comment.