Skip to content

Commit a298da1

Browse files
committed
Improve Plugin Codebase and Increase Release Version
1 parent f2affc4 commit a298da1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1108
-1283
lines changed

README.MD

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,25 @@ Install the plugin to `${JMETER_HOME}/lib/ext` on master and each slave machine
1717
> before continue
1818
1919
```properties
20-
# Remote properties
21-
# Specific the SampleSender class to let remote machine directly send to Influx Database
22-
# Ignore this property if the test is not running in distributed mode
23-
mode=org.ifisolution.plugins.samplers.InfluxSampleSender
20+
# Mandatory properties
21+
# Use this InfluxSampleSender to send test result to Influx Database before send it to master machine.
22+
# Exclude this property will disable this plugin.
23+
mode=com.nttdatavds.plugins.samplers.InfluxSampleSender
2424

25-
# Plugin properties
26-
# Setting this to true to let the master send test result to Influx Database
27-
master_send_result=
25+
# Test Specific properties
26+
# Set the name of the thread groups (comma separated value), which should be excluded from the result sent to Influx Database
27+
# By default, the excluded groups is ["setUp Thread Group", "tearDown Thread Group"]
28+
excluded.thread.groups=
2829

2930
# Test Specific properties
3031
# Set the option to save error response to true/false
3132
# By default, this plugin never save error response to reduce workload
32-
save_error_response=
33+
measure.save.error=
3334

3435
# Test Specific properties
3536
# Set the option to save sub result from sample result
3637
# By default, this property is set to true
37-
save_measure_sub_result=
38+
measure.sub.result=
3839

3940
# Test Specific properties
4041
# The test name that appears in Influx
@@ -71,15 +72,36 @@ influxdb.bucket=
7172
# Setting this to blank or ignore it will use the default http connection
7273
influxdb.ssl.enable=
7374

75+
# Optimization properties
76+
# The time for each virtual user metric sent to Influx in second
77+
# Default value is 1 second
78+
measure.user.interval=
79+
80+
# Optimization properties
81+
# The size of the executor used for sending virtual user metric in multi thread environment.
82+
# Default value is 10 threads available in pool
83+
measure.user.pool=
84+
85+
# Optimization properties
86+
# The size of the batching result sent to Influx Database.
87+
# Default is 1000 results
88+
write.batch=
89+
90+
# Optimization properties
91+
# The time for each request sent to Influx in millisecond
92+
# Default value is 1000 millisecond
93+
write.flush.interval=
94+
95+
# Optimization properties
96+
# The limitation of the buffer used for sending result to Influx Database
97+
# Default is 10000
98+
write.buffer.limit=
7499
```
75100

76-
This plugin can be configured from the master machine or configured on master and each slave machine
77-
78-
### Configure from the master machine
101+
### Usage
79102

80-
Create a new `.properties` file with the above properties and execute the test plan from the master machine with
81-
`-q path_to_created_property_file` and `-G path_to_created_property_file` option. For more information, refers
82-
to [Override Jmeter Properties](https://jmeter.apache.org/usermanual/get-started.html#override).
103+
Execute the test plan from the master machine with `-q` option and the `.properties` file contains above properties.
104+
For more information, refers to [Override Jmeter Properties](https://jmeter.apache.org/usermanual/get-started.html#override).
83105

84106
For example:
85107

@@ -88,23 +110,6 @@ jmeter -n -t Example-Apache-Jmeter-Plan.jmx -G influx.properties -q influx.prope
88110

89111
```
90112

91-
> Properties file should be the same. This file will apply the configuration for both master and slave machine(s)
92-
93-
### Or Configure on each machine
94-
95-
Add the above properties to `user.properties` (found in `${JMETER_HOME}/bin`) for master and each slave machine
96-
then restart Jmeter.
97-
98-
## Usage
99-
100-
This plugin comes with a `InfluxSampleSender` for sending Test Result directly to Influxdb from the slave machine
101-
and a BackendListenerClient for monitoring the Virtual users, Test-start and Test-end from the master machine.
102-
To do so, select the `InfluxTestStateListener` for Backend Listener implementation from the drop-down list.
103-
104-
![jmeter](https://github.com/vanduc2514/jmeter-influxdb2-remote/raw/master/image/jmeter.png)
105-
106-
After that, execute the test then verify it in Influx.
107-
108113
### Development
109114

110115
This plugin is an extension of the existing Batch mode found in Jmeter Remote testing. It is developed based on Custom
268 Bytes
Binary file not shown.

dev-tools/docker/install.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export JMETER_LIB=/jmeter/apache-jmeter-5.4.1/lib
2+
export JMETER_SLAVE=jmeter-slave
3+
export JMETER_MASTER=jmeter-master
4+
5+
docker stop $JMETER_SLAVE
6+
docker stop $JMETER_MASTER
7+
docker cp ../../target/jmeter-influxdb2-remote-*.jar jmeter-master:$JMETER_LIB
8+
docker cp ../../target/jmeter-influxdb2-remote-*.jar jmeter-slave:$JMETER_LIB
9+
docker start $JMETER_SLAVE
10+
docker start $JMETER_MASTER

dev-tools/docker/jmeter-image/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:11.0.4-jre-slim
1+
FROM eclipse-temurin:11.0.15_10-jre-jammy
22

33
ARG JMETER_VERSION
44

@@ -19,8 +19,8 @@ RUN wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-$JMETER_V
1919
# Enable debug
2020
ENV JVM_ARGS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000
2121

22-
# Add slave configuration in distrubuted testing
23-
COPY user.properties ./bin
22+
# Add pre configuration file
23+
COPY jmeter.properties /jmeter/apache-jmeter-5.4.1/bin
2424

2525
EXPOSE 1099 50000 60000 8000
2626

File renamed without changes.

dev-tools/install.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

dev-tools/test-plan/Example-Apache-Jmeter-Plan.jmx

Lines changed: 88 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.4.1">
2+
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.5">
33
<hashTree>
44
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
55
<stringProp name="TestPlan.comments"></stringProp>
@@ -12,47 +12,41 @@
1212
<stringProp name="TestPlan.user_define_classpath"></stringProp>
1313
</TestPlan>
1414
<hashTree>
15-
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Jmeter Users" enabled="true">
16-
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
15+
<SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="setUp Thread Group" enabled="true">
16+
<stringProp name="ThreadGroup.on_sample_error">startnextloop</stringProp>
1717
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
1818
<boolProp name="LoopController.continue_forever">false</boolProp>
1919
<stringProp name="LoopController.loops">1</stringProp>
2020
</elementProp>
21-
<stringProp name="ThreadGroup.num_threads">10</stringProp>
21+
<stringProp name="ThreadGroup.num_threads">1</stringProp>
2222
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
2323
<boolProp name="ThreadGroup.scheduler">false</boolProp>
2424
<stringProp name="ThreadGroup.duration"></stringProp>
2525
<stringProp name="ThreadGroup.delay"></stringProp>
26-
<boolProp name="ThreadGroup.same_user_on_next_iteration">false</boolProp>
27-
</ThreadGroup>
26+
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
27+
</SetupThreadGroup>
2828
<hashTree>
2929
<ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">
3030
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
3131
<collectionProp name="Arguments.arguments"/>
3232
</elementProp>
33-
<stringProp name="HTTPSampler.domain">jmeter.apache.org</stringProp>
34-
<stringProp name="HTTPSampler.port"></stringProp>
33+
<stringProp name="HTTPSampler.domain">localhost</stringProp>
34+
<stringProp name="HTTPSampler.port">8080</stringProp>
3535
<stringProp name="HTTPSampler.protocol"></stringProp>
3636
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
37-
<stringProp name="HTTPSampler.path"></stringProp>
37+
<stringProp name="HTTPSampler.path">/</stringProp>
3838
<stringProp name="HTTPSampler.concurrentPool">6</stringProp>
3939
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
4040
<stringProp name="HTTPSampler.response_timeout"></stringProp>
4141
</ConfigTestElement>
4242
<hashTree/>
43-
<CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true">
44-
<collectionProp name="CookieManager.cookies"/>
45-
<boolProp name="CookieManager.clearEachIteration">false</boolProp>
46-
<boolProp name="CookieManager.controlledByThreadGroup">false</boolProp>
47-
</CookieManager>
48-
<hashTree/>
49-
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Home Page" enabled="true">
43+
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Fake setup Request" enabled="true">
5044
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
5145
<collectionProp name="Arguments.arguments"/>
5246
</elementProp>
53-
<stringProp name="HTTPSampler.domain"></stringProp>
54-
<stringProp name="HTTPSampler.port"></stringProp>
55-
<stringProp name="HTTPSampler.protocol"></stringProp>
47+
<stringProp name="HTTPSampler.domain">localhost</stringProp>
48+
<stringProp name="HTTPSampler.port">8080</stringProp>
49+
<stringProp name="HTTPSampler.protocol">http</stringProp>
5650
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
5751
<stringProp name="HTTPSampler.path">/</stringProp>
5852
<stringProp name="HTTPSampler.method">GET</stringProp>
@@ -65,15 +59,87 @@
6559
<stringProp name="HTTPSampler.response_timeout"></stringProp>
6660
</HTTPSamplerProxy>
6761
<hashTree/>
68-
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Changes" enabled="true">
62+
<ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="Graph Results" enabled="true">
63+
<boolProp name="ResultCollector.error_logging">false</boolProp>
64+
<objProp>
65+
<name>saveConfig</name>
66+
<value class="SampleSaveConfiguration">
67+
<time>true</time>
68+
<latency>true</latency>
69+
<timestamp>true</timestamp>
70+
<success>true</success>
71+
<label>true</label>
72+
<code>true</code>
73+
<message>true</message>
74+
<threadName>true</threadName>
75+
<dataType>true</dataType>
76+
<encoding>false</encoding>
77+
<assertions>true</assertions>
78+
<subresults>true</subresults>
79+
<responseData>false</responseData>
80+
<samplerData>false</samplerData>
81+
<xml>false</xml>
82+
<fieldNames>true</fieldNames>
83+
<responseHeaders>false</responseHeaders>
84+
<requestHeaders>false</requestHeaders>
85+
<responseDataOnError>false</responseDataOnError>
86+
<saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
87+
<assertionsResultsToSave>0</assertionsResultsToSave>
88+
<bytes>true</bytes>
89+
<sentBytes>true</sentBytes>
90+
<url>true</url>
91+
<threadCounts>true</threadCounts>
92+
<idleTime>true</idleTime>
93+
<connectTime>true</connectTime>
94+
</value>
95+
</objProp>
96+
<stringProp name="filename"></stringProp>
97+
</ResultCollector>
98+
<hashTree/>
99+
</hashTree>
100+
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Jmeter Users" enabled="true">
101+
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
102+
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
103+
<boolProp name="LoopController.continue_forever">false</boolProp>
104+
<stringProp name="LoopController.loops">1</stringProp>
105+
</elementProp>
106+
<stringProp name="ThreadGroup.num_threads">1</stringProp>
107+
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
108+
<boolProp name="ThreadGroup.scheduler">false</boolProp>
109+
<stringProp name="ThreadGroup.duration"></stringProp>
110+
<stringProp name="ThreadGroup.delay"></stringProp>
111+
<boolProp name="ThreadGroup.same_user_on_next_iteration">false</boolProp>
112+
</ThreadGroup>
113+
<hashTree>
114+
<ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">
69115
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
70116
<collectionProp name="Arguments.arguments"/>
71117
</elementProp>
72-
<stringProp name="HTTPSampler.domain"></stringProp>
118+
<stringProp name="HTTPSampler.domain">jmeter.apache.org</stringProp>
73119
<stringProp name="HTTPSampler.port"></stringProp>
74120
<stringProp name="HTTPSampler.protocol"></stringProp>
75121
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
76-
<stringProp name="HTTPSampler.path">/changes.html</stringProp>
122+
<stringProp name="HTTPSampler.path"></stringProp>
123+
<stringProp name="HTTPSampler.concurrentPool">6</stringProp>
124+
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
125+
<stringProp name="HTTPSampler.response_timeout"></stringProp>
126+
</ConfigTestElement>
127+
<hashTree/>
128+
<CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true">
129+
<collectionProp name="CookieManager.cookies"/>
130+
<boolProp name="CookieManager.clearEachIteration">false</boolProp>
131+
<boolProp name="CookieManager.controlledByThreadGroup">false</boolProp>
132+
</CookieManager>
133+
<hashTree/>
134+
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Local Server" enabled="true">
135+
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
136+
<collectionProp name="Arguments.arguments"/>
137+
</elementProp>
138+
<stringProp name="HTTPSampler.domain">localhost</stringProp>
139+
<stringProp name="HTTPSampler.port">8080</stringProp>
140+
<stringProp name="HTTPSampler.protocol"></stringProp>
141+
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
142+
<stringProp name="HTTPSampler.path">/</stringProp>
77143
<stringProp name="HTTPSampler.method">GET</stringProp>
78144
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
79145
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
@@ -121,49 +187,6 @@
121187
<stringProp name="filename"></stringProp>
122188
</ResultCollector>
123189
<hashTree/>
124-
<BackendListener guiclass="BackendListenerGui" testclass="BackendListener" testname="Backend Listener" enabled="true">
125-
<elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
126-
<collectionProp name="Arguments.arguments">
127-
<elementProp name="graphiteMetricsSender" elementType="Argument">
128-
<stringProp name="Argument.name">graphiteMetricsSender</stringProp>
129-
<stringProp name="Argument.value">org.apache.jmeter.visualizers.backend.graphite.TextGraphiteMetricsSender</stringProp>
130-
<stringProp name="Argument.metadata">=</stringProp>
131-
</elementProp>
132-
<elementProp name="graphiteHost" elementType="Argument">
133-
<stringProp name="Argument.name">graphiteHost</stringProp>
134-
<stringProp name="Argument.value"></stringProp>
135-
<stringProp name="Argument.metadata">=</stringProp>
136-
</elementProp>
137-
<elementProp name="graphitePort" elementType="Argument">
138-
<stringProp name="Argument.name">graphitePort</stringProp>
139-
<stringProp name="Argument.value">2003</stringProp>
140-
<stringProp name="Argument.metadata">=</stringProp>
141-
</elementProp>
142-
<elementProp name="rootMetricsPrefix" elementType="Argument">
143-
<stringProp name="Argument.name">rootMetricsPrefix</stringProp>
144-
<stringProp name="Argument.value">jmeter.</stringProp>
145-
<stringProp name="Argument.metadata">=</stringProp>
146-
</elementProp>
147-
<elementProp name="summaryOnly" elementType="Argument">
148-
<stringProp name="Argument.name">summaryOnly</stringProp>
149-
<stringProp name="Argument.value">true</stringProp>
150-
<stringProp name="Argument.metadata">=</stringProp>
151-
</elementProp>
152-
<elementProp name="samplersList" elementType="Argument">
153-
<stringProp name="Argument.name">samplersList</stringProp>
154-
<stringProp name="Argument.value"></stringProp>
155-
<stringProp name="Argument.metadata">=</stringProp>
156-
</elementProp>
157-
<elementProp name="percentiles" elementType="Argument">
158-
<stringProp name="Argument.name">percentiles</stringProp>
159-
<stringProp name="Argument.value">90;95;99</stringProp>
160-
<stringProp name="Argument.metadata">=</stringProp>
161-
</elementProp>
162-
</collectionProp>
163-
</elementProp>
164-
<stringProp name="classname">org.ifisolution.plugins.listeners.InfluxTestStateListener</stringProp>
165-
</BackendListener>
166-
<hashTree/>
167190
</hashTree>
168191
</hashTree>
169192
</hashTree>

dev-tools/test-plan/example.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# The Custom Sample Sender which directly send Sample Result to InfluxDB
2-
mode=org.ifisolution.plugins.samplers.InfluxSampleSender
2+
mode=com.nttdatavds.InfluxSampleSender
33

44
# Test Specific properties
55
# The test name that appears in Influx
@@ -12,7 +12,7 @@ test.runId=000000
1212
# Influx properties
1313
# The host name of Influx database, whether it is a resolved name or an Ip address
1414
# Example: localhost
15-
influxdb.hostname=localhost
15+
influxdb.hostname=influxdb
1616

1717
# Influx properties
1818
# The port of Influx database
@@ -21,12 +21,12 @@ influxdb.port=8086
2121

2222
# Influx properties
2323
# Raw bucket token string generated from Influx
24-
influxdb.token=
24+
influxdb.token=kdmvyTxSSnHTsX6xEFwH_5RnQJW_y1d68ximPKiQOzDvyFwAY0_fABkhJOTIfQ4cDm6zLptUwZYM165-DkgQoQ==
2525

2626
# Influx properties
2727
# The organization name of Influx database
28-
influxdb.organization=
28+
influxdb.organization=ifisolution
2929

3030
# Influx properties
3131
# The bucket name from Influx database
32-
influxdb.bucket=
32+
influxdb.bucket=jmeter

0 commit comments

Comments
 (0)