File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
src/main/java/io/github/delirius325/jmeter/backendlistener/elasticsearch Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 33 <modelVersion >4.0.0</modelVersion >
44 <groupId >io.github.delirius325</groupId >
55 <artifactId >jmeter.backendlistener.elasticsearch</artifactId >
6- <version >2.5.2 </version >
6+ <version >2.5.3-SNAPSHOT </version >
77 <packaging >jar</packaging >
88
99 <name >jmeter.backendlistener.elasticsearch</name >
Original file line number Diff line number Diff line change @@ -154,13 +154,18 @@ private void checkTestMode(String mode) {
154154 * @return true or false depending on whether or not the sample is valid
155155 */
156156 private boolean validateSample (BackendListenerContext context , SampleResult sr ) {
157- boolean validSample = false ;
157+ boolean valid = true ;
158158 String sampleLabel = sr .getSampleLabel ().toLowerCase ().trim ();
159159
160- if (this .filters .size () == 0 || this .filters .contains (sampleLabel )) {
161- validSample = !(context .getParameter (ES_TEST_MODE ).trim ().equals ("error" ) && sr .isSuccessful ());
160+ if (this .filters .size () > 0 ) {
161+ for (String filter : filters ) {
162+ // if sample label doesn't contain the filter AND sample is successful + test mode != error then the sample isn't valid
163+ if (!sampleLabel .contains (filter ) && (sr .isSuccessful () && !context .getParameter (ES_TEST_MODE ).trim ().equalsIgnoreCase ("error" ))) {
164+ valid = false ;
165+ }
166+ }
162167 }
163168
164- return validSample ;
169+ return valid ;
165170 }
166171}
You can’t perform that action at this time.
0 commit comments