|
30 | 30 | /** |
31 | 31 | * |
32 | 32 | * @author: Delirius325 |
33 | | - * @inspired_by: korteke & zumo64 |
34 | | - * @source_1: https://github.com/korteke/JMeter_ElasticsearchBackendListener |
35 | | - * @source_2: https://github.com/zumo64/ELK_POC |
36 | 33 | */ |
37 | 34 | public class ElasticsearchBackend extends AbstractBackendListenerClient { |
38 | 35 | private static final String BUILD_NUMBER = "BuildNumber"; |
39 | 36 | private static final String ES_SCHEME = "es.scheme"; |
40 | 37 | private static final String ES_HOST = "es.host"; |
41 | | - private static final String ES_PORT = "es.transport.port"; |
| 38 | + private static final String ES_PORT = "es.port"; |
42 | 39 | private static final String ES_INDEX = "es.index"; |
43 | 40 | private static final String ES_TIMESTAMP = "es.timestamp"; |
44 | 41 | private static final String ES_STATUS_CODE = "es.status.code"; |
@@ -110,12 +107,13 @@ public void onFailure(HttpHost host) { |
110 | 107 | public void handleSampleResults(List<SampleResult> results, BackendListenerContext context) { |
111 | 108 | for(SampleResult sr : results) { |
112 | 109 | boolean validSample = false; |
| 110 | + String sampleLabel = sr.getSampleLabel().toLowerCase().trim(); |
113 | 111 |
|
114 | 112 | if(this.filters == null) { |
115 | 113 | validSample = true; |
116 | 114 | } else { |
117 | 115 | for(String filter : this.filters) { |
118 | | - if(filter.toLowerCase().trim().equals(sr.getSampleLabel().toLowerCase().trim())) { |
| 116 | + if(filter.toLowerCase().trim().equals(sampleLabel) || sampleLabel.contains(filter.toLowerCase().trim())) { |
119 | 117 | validSample = true; |
120 | 118 | break; |
121 | 119 | } |
@@ -169,7 +167,7 @@ private void sendRequest(List<String> bulkList) throws IOException { |
169 | 167 | } |
170 | 168 | } catch (Exception e) { |
171 | 169 | if(logger.isErrorEnabled()) { |
172 | | - logger.error("ElasticSearch Backend Listener was unable to perform request to the ElasticSearch engine."); |
| 170 | + logger.error("ElasticSearch Backend Listener was unable to perform request to the ElasticSearch engine. Request reached timeout."); |
173 | 171 | } |
174 | 172 | } |
175 | 173 | } |
|
0 commit comments