Skip to content

Commit da59321

Browse files
mderevyankoaqaMikhail.Derevyanko
andauthored
Performance improvements (#27)
* Developed batches to improve the performance of the metrics sending. Now its possible to control the batch size and frequency of the data importing. See read me for the details. * Improved string messages saving. * Updated libs. * Supported the dashboard (compatible with Grafana 8.2.3) - tables have been updated as well. No its possible to sort data. Co-authored-by: Mikhail.Derevyanko <[email protected]>
1 parent ca90d53 commit da59321

17 files changed

+1729
-1623
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 97 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@ The plugin sends metrics to InfluxDB and provides the possibility to visualize t
1212
* Latency;
1313
* The response time (uses from the SampleResult.class, needs to make aggregate report).
1414

15+
## Important notes
16+
The plugin allows 5 errors happened one by one, then plugin will stop importing the results after that! See details in the logs.
17+
Counter will be refreshed at least you have 4 fails. This is protection to avoid OOM error.
18+
19+
Pleas monitor the elapsed time of the data importing (see logs) to avoid issues with requests sending from JMeter.
20+
Pay attention on "Sending metrics performance tuning" chapter, see below.
1521

1622
## Compatibility
1723
The supported versions:
18-
* Java 11 - make sure that you have it.
24+
* Java 11 - make sure that you have it (its minimum version).
1925
* InfluxDB v2.0, see release notes: https://docs.influxdata.com/influxdb/v2.0/reference/release-notes/influxdb/ (1.8 is not supported)
20-
* JMeter 5.4.1 only (the previous supports 3.5)
26+
* JMeter 5.4.1 only.
27+
* The current board and plugin were tested on Grafana 8.2.3 and InfluxDB 2.0.9, JAVA 15.
2128

2229
## Deployment
2330
* Put '`jmeter-plugin-influxdb2-listener-<version>.jar`' file from [Releases](https://github.com/mderevyankoaqa/jmeter-influxdb2-listener-plugin/releases) to `~<JmeterPath<\lib\ext`;
@@ -48,10 +55,13 @@ Let’s explain the plugin fields:
4855
* `testName` - the name of the test.
4956
* `nodeName` - the name of the server.
5057
* `runId` - the identification number of hte test run, can be dynamic.
51-
* `influxDBScheme` - InfluxDB server scheme (can be http or https) .
58+
* `influxDBScheme` - InfluxDB server scheme (can be http or https).
5259
* `influxDBHost` - the host name or ip of the InfluxDB server.
5360
* `influxDBPort` - the port of the InfluxDB server, the default is 8086.
5461
* `influxDBToken` - the influxdb bucket token, the default value should be updated, copy it from InfluxDB site.
62+
* `influxDBFlushInterval` - its interval to send data to InfluxDB, the default value is 4000 (4 seconds).
63+
* `influxDBMaxBatchSize` - the max size of the batch with metrics, the default 2000 (2000 items of JMeter results).
64+
5565

5666
![](img/influx3.png)
5767

@@ -76,6 +86,18 @@ You can modify the generated string in terms of your purposes.
7686
* `recordSubSamples` - allows to save the JMeter sub samples if set to 'true'.
7787
* `saveResponseBodyOfFailures` - allows to save the response body of the failures.
7888

89+
## Sending metrics performance tuning
90+
The plugin imports batch with JMeter results each 4 seconds (by default settings). In the logs you will see records like this:
91+
`INFO o.m.j.i.v.InfluxDatabaseBackendListenerClient: Data has been imported successfully, batch size --> 68, elapsed time is --> 14 ms` (the elapsed time is the response time of the batch importing.)
92+
So you can control the flush interval depends on the load you have and adjust `influxDBFlushInterval` setting. Is not recommended having less 1 second.
93+
Max batch protection -> send data when batch max size is occurred. For example, when batch size is 2000 items (it's the default setting of `influxDBMaxBatchSize`) plugin imports that batch, even when flush interval was not occurred.
94+
Using both options you can tune data importing and have optimal performance.
95+
96+
Make sure you have enough ram to aggregate huge batch and optimal flush period.
97+
98+
Notes: when test has been interrupted from UI; the processes may not be finished properly, restart JMeter.
99+
100+
79101
## Grafana dashboard capabilities
80102
See deployment instructions here https://grafana.com/grafana/dashboards/13644
81103

@@ -87,24 +109,26 @@ Dashboard helps:
87109
* Overview and analise the response time, distribution as well.
88110

89111
![](img/grafana2.png)
112+
113+
![](img/grafana3.png)
90114

91115
* See aggregate report.
92116
The table rendering may take an extra time. The table has hardware resources consuming queries from Influxdb side. If you have low hardware on the Influxdb server - recommended make the clone of the original dashboard and remove aggregate report.
93117
So the idea - it's to have one 'fast' dashboard for the online monitoring (has no aggregate report) to see the results while the test, the second (original with aggregate report) to see the final results.
94-
95-
![](img/grafana3.png)
118+
119+
![](img/grafana4.png)
96120

97121
* Investigate errors. The table is interactive, it's possible to filter data in the columns and see details for the specific error.
98122

99-
![](img/grafana4.png)
123+
![](img/grafana5.png)
100124

101125
* See network statistics, latency, processing time.
102-
103-
![](img/grafana5.png)
126+
127+
![](img/grafana6.png)
104128

105129
* Check individual request details.
106130

107-
![](img/grafana6.png)
131+
![](img/grafana7.png)
108132

109133

110134

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repositories {
1414
}
1515

1616
sourceCompatibility = 11
17-
version = '1.2'
17+
version = '1.3'
1818
def title = 'JMeterInfluxDBListener'
1919
def archiveName = 'jmeter-plugin-influxdb2-listener'
2020

0 commit comments

Comments
 (0)