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

Improvements: changed the URL and updated libs #80

Merged
merged 7 commits into from
Nov 16, 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
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ Let’s explain the plugin fields:
* `testName` - the name of the test.
* `nodeName` - the name of the server.
* `runId` - the identification number of hte test run, can be dynamic.
* `influxDBScheme` - InfluxDB server scheme (can be http or https).
* `influxDBHost` - the host name or ip of the InfluxDB server.
* `influxDBPort` - the port of the InfluxDB server, the default is 8086.
* `influxDBURL` - InfluxDB server URL [protocol://][host][:port], protocol (can be http or https) and the default port is 8086.
* `influxDBToken` - the influxdb bucket token, the default value should be updated, copy it from InfluxDB site.

![](img/influx3.png)
Expand Down Expand Up @@ -194,9 +192,8 @@ 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)
![](img/filterById.png)
![](img/filterByType.png)


* Monitor throughput with active users.
Expand Down
14 changes: 10 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ repositories {

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

def title = 'JMeterInfluxDB2Listener'
def archiveName = 'jmeter-plugins-influxdb2-listener'

Expand All @@ -45,10 +46,9 @@ 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.5.0'
implementation group: 'com.influxdb', name: 'influxdb-client-java', version: '6.7.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'

implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_http', version: '5.5'
components {
withModule("org.apache.jmeter:ApacheJMeter_core", JMeterRule)
withModule("org.apache.jmeter:ApacheJMeter_java", JMeterRule)
Expand Down Expand Up @@ -137,6 +137,12 @@ publishing {
name = 'Uladzislau Shklianik'
email = 'Uladzislau_Shklianik@epam.com'
}
i developer {
id = 'MalshaUdani'
name = 'Malsha Nagahawatta'
email = 'malsha.nagahawatta@gmail.com'
}

}
scm {
connection = 'scm:git:git:github.com/mderevyankoaqa/jmeter-influxdb2-listener-plugin.git'
Expand Down
Binary file added img/UpgradeFrom2.5To2.6.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 @@ -157,9 +157,7 @@ public Arguments getDefaultParameters() {
arguments.addArgument(KEY_TEST_NAME, "Test");
arguments.addArgument(KEY_NODE_NAME, "Test-Node");
arguments.addArgument(KEY_RUN_ID, "R001");
arguments.addArgument(InfluxDBConfig.KEY_HTTP_SCHEME, InfluxDBConfig.DEFAULT_HTTP_SCHEME);
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_HOST, "localhost");
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_PORT, Integer.toString(InfluxDBConfig.DEFAULT_PORT));
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_URL, InfluxDBConfig.DEFAULT_INFLUXDB_URL);
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_TOKEN, InfluxDBConfig.DEFAULT_INFLUX_DB_TOKEN);
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_ORG, InfluxDBConfig.DEFAULT_INFLUX_DB_ORG);
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_BUCKET, InfluxDBConfig.DEFAULT_BUCKET);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@ public class InfluxDBConfig {
public static final String DEFAULT_BUCKET = "jmeter";

/**
* Default http scheme name.
* Default influxdb url.
*/
public static final String DEFAULT_HTTP_SCHEME = "http";

/**
* Default port.
*/
public static final int DEFAULT_PORT = 8086;
public static final String DEFAULT_INFLUXDB_URL = "http://localhost:8086/";

/**
* Default threshold error.
Expand Down Expand Up @@ -57,6 +52,11 @@ public class InfluxDBConfig {
*/
public static final int DEFAULT_RESPONSE_BODY_LENGTH = 2000;

/**
* Config key for influxdb url.
*/
public static final String KEY_INFLUX_DB_URL = "influxDBURL";

/**
* Config key for bucket.
*/
Expand All @@ -72,21 +72,6 @@ public class InfluxDBConfig {
*/
public static final String KEY_INFLUX_DB_TOKEN = "influxDBToken";

/**
* Config key for port.
*/
public static final String KEY_INFLUX_DB_PORT = "influxDBPort";

/**
* Config key for host.
*/
public static final String KEY_INFLUX_DB_HOST = "influxDBHost";

/**
* Config key for http scheme.
*/
public static final String KEY_HTTP_SCHEME = "influxDBHttpScheme";

/**
* Config key for batch size.
*/
Expand All @@ -108,9 +93,9 @@ public class InfluxDBConfig {
public static final String KEY_RESPONSE_BODY_LENGTH = "responseBodyLength";

/**
* InfluxDB Host.
* InfluxDB URL.
*/
private String influxDBHost;
private String influxDBURL;

/**
* InfluxDB Token.
Expand All @@ -127,16 +112,6 @@ public class InfluxDBConfig {
*/
private String influxBucket;

/**
* InfluxDB Port.
*/
private int influxDBPort;

/**
* InfluxDB database retention policy.
*/
private String influxHTTPScheme;

/**
* InfluxDB database batch size.
*/
Expand All @@ -163,12 +138,11 @@ public class InfluxDBConfig {
* @param context the {@link BackendListenerContext}
*/
public InfluxDBConfig(BackendListenerContext context) {
String influxDBHost = context.getParameter(KEY_INFLUX_DB_HOST);
Arguments.checkNonEmpty(KEY_INFLUX_DB_BUCKET, influxDBHost);
this.setInfluxDBHost(influxDBHost);

int influxDBPort = context.getIntParameter(KEY_INFLUX_DB_PORT, InfluxDBConfig.DEFAULT_PORT);
this.setInfluxDBPort(influxDBPort);
String influxDBURL = context.getParameter(KEY_INFLUX_DB_URL);
Arguments.checkNonEmpty(influxDBURL, KEY_INFLUX_DB_URL);
String[] influxHTTPScheme = influxDBURL.split("://",2);
ArgsValidator.checkHTTPScheme(influxHTTPScheme[0]);
this.setInfluxDBURL(influxDBURL);

String influxToken = context.getParameter(KEY_INFLUX_DB_TOKEN);
Arguments.checkNonEmpty(influxToken, KEY_INFLUX_DB_TOKEN);
Expand All @@ -182,9 +156,6 @@ public InfluxDBConfig(BackendListenerContext context) {
Arguments.checkNonEmpty(influxBucket, KEY_INFLUX_DB_BUCKET);
this.setInfluxBucket(influxBucket);

String influxHTTPScheme = ArgsValidator.checkHTTPScheme(context.getParameter(KEY_HTTP_SCHEME, DEFAULT_HTTP_SCHEME));
this.setInfluxHTTPScheme(influxHTTPScheme);

int influxdbBatchSize = context.getIntParameter(KEY_INFLUX_DB_MAX_BATCH_SIZE);
Arguments.checkNotNegativeNumber(influxdbBatchSize, KEY_INFLUX_DB_MAX_BATCH_SIZE);
this.setInfluxdbBatchSize(influxdbBatchSize);
Expand All @@ -203,30 +174,21 @@ public InfluxDBConfig(BackendListenerContext context) {
}

/**
* Builds URL to influxDB.
* Gets the InfluxDB URL.
*
* @return influxDB URL.
* @return the InfluxDB URL.
*/
public String getInfluxDBURL() {
return this.influxHTTPScheme + "://" + this.getInfluxDBHost() + ":" + this.getInfluxDBPort();
}

/**
* Gets the influxDBHost.
*
* @return the influxDBHost.
*/
public String getInfluxDBHost() {
return this.influxDBHost;
return influxDBURL;
}

/**
* Sets influxDBHost.
* Sets influxDB URL.
*
* @param influxDBHost the influxDBHost to set.
* @param influxDBURL the influxdb host url.
*/
public void setInfluxDBHost(String influxDBHost) {
this.influxDBHost = influxDBHost;
public void setInfluxDBURL(String influxDBURL) {
this.influxDBURL = influxDBURL;
}

/**
Expand All @@ -247,33 +209,6 @@ public void setInfluxBucket(String influxBucket) {
this.influxBucket = influxBucket;
}

/**
* Sets influxHTTPScheme.
*
* @param influxHTTPScheme the influxHTTPScheme to set.
*/
public void setInfluxHTTPScheme(String influxHTTPScheme) {
this.influxHTTPScheme = influxHTTPScheme;
}

/**
* Gets influxDBPort.
*
* @return the influxDBPort.
*/
public int getInfluxDBPort() {
return this.influxDBPort;
}

/**
* Sets setInfluxDBPort.
*
* @param influxDBPort the influxDBPort to set.
*/
public void setInfluxDBPort(int influxDBPort) {
this.influxDBPort = influxDBPort;
}

/**
* Gets the InfluxDB organization.
*
Expand Down