Skip to content

Commit 290d55f

Browse files
mderevyankoaqaMikhail.DerevyankoushklianikushklianikMikhail Derevyanko
authored
Improvements: changed the URL and updated libs (#80)
* Supported JMeter 5.5 (#54) Co-authored-by: Mikhail.Derevyanko <[email protected]> * New sample type tag (#67) These changes allow you to save to the database whether it is a request or a transaction. Which greatly simplifies data visualization and determining what is a request and what is a transaction controller. Co-authored-by: ushklianik <[email protected]> * Libs update: the influxdb-client-java to 6.5.0 and gradle to 7.5.1, readme and borad updated as well * Added influxdb url config (#77) * Updated the influxdb-client-java Co-authored-by: Mikhail.Derevyanko <[email protected]> Co-authored-by: ushklianik <[email protected]> Co-authored-by: ushklianik <[email protected]> Co-authored-by: Mikhail Derevyanko <[email protected]> Co-authored-by: MalshaUdani <[email protected]>
1 parent b0b9e58 commit 290d55f

File tree

5 files changed

+35
-99
lines changed

5 files changed

+35
-99
lines changed

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ Let’s explain the plugin fields:
148148
* `testName` - the name of the test.
149149
* `nodeName` - the name of the server.
150150
* `runId` - the identification number of hte test run, can be dynamic.
151-
* `influxDBScheme` - InfluxDB server scheme (can be http or https).
152-
* `influxDBHost` - the host name or ip of the InfluxDB server.
153-
* `influxDBPort` - the port of the InfluxDB server, the default is 8086.
151+
* `influxDBURL` - InfluxDB server URL [protocol://][host][:port], protocol (can be http or https) and the default port is 8086.
154152
* `influxDBToken` - the influxdb bucket token, the default value should be updated, copy it from InfluxDB site.
155153

156154
![](img/influx3.png)
@@ -194,9 +192,8 @@ See deployment instructions here https://grafana.com/grafana/dashboards/13644
194192

195193
Dashboard helps:
196194
* Filter the results by Run Id or Type (can be requests or transactions).
197-
198-
![](img/filterById.png)
199-
![](img/filterByType.png)
195+
![](img/filterById.png)
196+
![](img/filterByType.png)
200197

201198

202199
* Monitor throughput with active users.

build.gradle

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ repositories {
2424

2525
sourceCompatibility = 11
2626
group = 'io.github.mderevyankoaqa'
27-
version = '2.5'
27+
version = '2.6'
28+
2829
def title = 'JMeterInfluxDB2Listener'
2930
def archiveName = 'jmeter-plugins-influxdb2-listener'
3031

@@ -45,10 +46,9 @@ def archiveName = 'jmeter-plugins-influxdb2-listener'
4546
implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_java', version: '5.5'
4647
implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_components', version: '5.5'
4748
implementation group: 'org.apache.jmeter', name: 'jorphan', version: '5.5'
48-
implementation group: 'com.influxdb', name: 'influxdb-client-java', version: '6.5.0'
49+
implementation group: 'com.influxdb', name: 'influxdb-client-java', version: '6.7.0'
4950
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
50-
implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_http', version: '5.4.3'
51-
51+
implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_http', version: '5.5'
5252
components {
5353
withModule("org.apache.jmeter:ApacheJMeter_core", JMeterRule)
5454
withModule("org.apache.jmeter:ApacheJMeter_java", JMeterRule)
@@ -137,6 +137,12 @@ publishing {
137137
name = 'Uladzislau Shklianik'
138138
139139
}
140+
i developer {
141+
id = 'MalshaUdani'
142+
name = 'Malsha Nagahawatta'
143+
144+
}
145+
140146
}
141147
scm {
142148
connection = 'scm:git:git:github.com/mderevyankoaqa/jmeter-influxdb2-listener-plugin.git'

img/UpgradeFrom2.5To2.6.png

35.3 KB
Loading

src/main/java/io/github/mderevyankoaqa/influxdb2/visualizer/InfluxDatabaseBackendListenerClient.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,7 @@ public Arguments getDefaultParameters() {
157157
arguments.addArgument(KEY_TEST_NAME, "Test");
158158
arguments.addArgument(KEY_NODE_NAME, "Test-Node");
159159
arguments.addArgument(KEY_RUN_ID, "R001");
160-
arguments.addArgument(InfluxDBConfig.KEY_HTTP_SCHEME, InfluxDBConfig.DEFAULT_HTTP_SCHEME);
161-
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_HOST, "localhost");
162-
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_PORT, Integer.toString(InfluxDBConfig.DEFAULT_PORT));
160+
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_URL, InfluxDBConfig.DEFAULT_INFLUXDB_URL);
163161
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_TOKEN, InfluxDBConfig.DEFAULT_INFLUX_DB_TOKEN);
164162
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_ORG, InfluxDBConfig.DEFAULT_INFLUX_DB_ORG);
165163
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_BUCKET, InfluxDBConfig.DEFAULT_BUCKET);

src/main/java/io/github/mderevyankoaqa/influxdb2/visualizer/config/InfluxDBConfig.java

Lines changed: 21 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,9 @@ public class InfluxDBConfig {
1818
public static final String DEFAULT_BUCKET = "jmeter";
1919

2020
/**
21-
* Default http scheme name.
21+
* Default influxdb url.
2222
*/
23-
public static final String DEFAULT_HTTP_SCHEME = "http";
24-
25-
/**
26-
* Default port.
27-
*/
28-
public static final int DEFAULT_PORT = 8086;
23+
public static final String DEFAULT_INFLUXDB_URL = "http://localhost:8086/";
2924

3025
/**
3126
* Default threshold error.
@@ -57,6 +52,11 @@ public class InfluxDBConfig {
5752
*/
5853
public static final int DEFAULT_RESPONSE_BODY_LENGTH = 2000;
5954

55+
/**
56+
* Config key for influxdb url.
57+
*/
58+
public static final String KEY_INFLUX_DB_URL = "influxDBURL";
59+
6060
/**
6161
* Config key for bucket.
6262
*/
@@ -72,21 +72,6 @@ public class InfluxDBConfig {
7272
*/
7373
public static final String KEY_INFLUX_DB_TOKEN = "influxDBToken";
7474

75-
/**
76-
* Config key for port.
77-
*/
78-
public static final String KEY_INFLUX_DB_PORT = "influxDBPort";
79-
80-
/**
81-
* Config key for host.
82-
*/
83-
public static final String KEY_INFLUX_DB_HOST = "influxDBHost";
84-
85-
/**
86-
* Config key for http scheme.
87-
*/
88-
public static final String KEY_HTTP_SCHEME = "influxDBHttpScheme";
89-
9075
/**
9176
* Config key for batch size.
9277
*/
@@ -108,9 +93,9 @@ public class InfluxDBConfig {
10893
public static final String KEY_RESPONSE_BODY_LENGTH = "responseBodyLength";
10994

11095
/**
111-
* InfluxDB Host.
96+
* InfluxDB URL.
11297
*/
113-
private String influxDBHost;
98+
private String influxDBURL;
11499

115100
/**
116101
* InfluxDB Token.
@@ -127,16 +112,6 @@ public class InfluxDBConfig {
127112
*/
128113
private String influxBucket;
129114

130-
/**
131-
* InfluxDB Port.
132-
*/
133-
private int influxDBPort;
134-
135-
/**
136-
* InfluxDB database retention policy.
137-
*/
138-
private String influxHTTPScheme;
139-
140115
/**
141116
* InfluxDB database batch size.
142117
*/
@@ -163,12 +138,11 @@ public class InfluxDBConfig {
163138
* @param context the {@link BackendListenerContext}
164139
*/
165140
public InfluxDBConfig(BackendListenerContext context) {
166-
String influxDBHost = context.getParameter(KEY_INFLUX_DB_HOST);
167-
Arguments.checkNonEmpty(KEY_INFLUX_DB_BUCKET, influxDBHost);
168-
this.setInfluxDBHost(influxDBHost);
169-
170-
int influxDBPort = context.getIntParameter(KEY_INFLUX_DB_PORT, InfluxDBConfig.DEFAULT_PORT);
171-
this.setInfluxDBPort(influxDBPort);
141+
String influxDBURL = context.getParameter(KEY_INFLUX_DB_URL);
142+
Arguments.checkNonEmpty(influxDBURL, KEY_INFLUX_DB_URL);
143+
String[] influxHTTPScheme = influxDBURL.split("://",2);
144+
ArgsValidator.checkHTTPScheme(influxHTTPScheme[0]);
145+
this.setInfluxDBURL(influxDBURL);
172146

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

185-
String influxHTTPScheme = ArgsValidator.checkHTTPScheme(context.getParameter(KEY_HTTP_SCHEME, DEFAULT_HTTP_SCHEME));
186-
this.setInfluxHTTPScheme(influxHTTPScheme);
187-
188159
int influxdbBatchSize = context.getIntParameter(KEY_INFLUX_DB_MAX_BATCH_SIZE);
189160
Arguments.checkNotNegativeNumber(influxdbBatchSize, KEY_INFLUX_DB_MAX_BATCH_SIZE);
190161
this.setInfluxdbBatchSize(influxdbBatchSize);
@@ -203,30 +174,21 @@ public InfluxDBConfig(BackendListenerContext context) {
203174
}
204175

205176
/**
206-
* Builds URL to influxDB.
177+
* Gets the InfluxDB URL.
207178
*
208-
* @return influxDB URL.
179+
* @return the InfluxDB URL.
209180
*/
210181
public String getInfluxDBURL() {
211-
return this.influxHTTPScheme + "://" + this.getInfluxDBHost() + ":" + this.getInfluxDBPort();
212-
}
213-
214-
/**
215-
* Gets the influxDBHost.
216-
*
217-
* @return the influxDBHost.
218-
*/
219-
public String getInfluxDBHost() {
220-
return this.influxDBHost;
182+
return influxDBURL;
221183
}
222184

223185
/**
224-
* Sets influxDBHost.
186+
* Sets influxDB URL.
225187
*
226-
* @param influxDBHost the influxDBHost to set.
188+
* @param influxDBURL the influxdb host url.
227189
*/
228-
public void setInfluxDBHost(String influxDBHost) {
229-
this.influxDBHost = influxDBHost;
190+
public void setInfluxDBURL(String influxDBURL) {
191+
this.influxDBURL = influxDBURL;
230192
}
231193

232194
/**
@@ -247,33 +209,6 @@ public void setInfluxBucket(String influxBucket) {
247209
this.influxBucket = influxBucket;
248210
}
249211

250-
/**
251-
* Sets influxHTTPScheme.
252-
*
253-
* @param influxHTTPScheme the influxHTTPScheme to set.
254-
*/
255-
public void setInfluxHTTPScheme(String influxHTTPScheme) {
256-
this.influxHTTPScheme = influxHTTPScheme;
257-
}
258-
259-
/**
260-
* Gets influxDBPort.
261-
*
262-
* @return the influxDBPort.
263-
*/
264-
public int getInfluxDBPort() {
265-
return this.influxDBPort;
266-
}
267-
268-
/**
269-
* Sets setInfluxDBPort.
270-
*
271-
* @param influxDBPort the influxDBPort to set.
272-
*/
273-
public void setInfluxDBPort(int influxDBPort) {
274-
this.influxDBPort = influxDBPort;
275-
}
276-
277212
/**
278213
* Gets the InfluxDB organization.
279214
*

0 commit comments

Comments
 (0)