anthonygauthier/jmeter-elasticsearch-backend-listener

Headers parsing issue

ncasaux opened this issue · 5 comments

Hello,

Tested with version 2.5.4 of the plug-in

When I set the es.parse.all.req.headers parameter to true, it works fine with HTTP Sampler. However, it doesn't work for some other samplers, like WebSocket Samplers (by Peter Doornbosch) or even Debug Sampler.

In JMeter, the error is:
2019-02-23 23:13:59,218 ERROR i.g.d.j.b.e.ElasticsearchBackendClient: The ElasticSearch Backend Listener was unable to a sampler to the list of samplers to send... More info in JMeter's console.

In the console, the exception is:

java.lang.ArrayIndexOutOfBoundsException: 1
        at io.github.delirius325.jmeter.backendlistener.elasticsearch.ElasticSearchMetric.parseHeadersAsJsonProps(ElasticSearchMetric.java:205)
        at io.github.delirius325.jmeter.backendlistener.elasticsearch.ElasticSearchMetric.getMetric(ElasticSearchMetric.java:88)
        at io.github.delirius325.jmeter.backendlistener.elasticsearch.ElasticsearchBackendClient.handleSampleResults(ElasticsearchBackendClient.java:107)
        at org.apache.jmeter.visualizers.backend.BackendListener.sendToListener(BackendListener.java:267)
        at org.apache.jmeter.visualizers.backend.BackendListener$Worker.run(BackendListener.java:239)

Maybe when there are no headers at all, it tries to parse anyway?

You can easily reproduce the bug with a Debug Sampler.

Hi @ncasaux,

There was indeed an issue where the plugin was trying to parse the headers even though they did not exist. I added a verification and pushed version 2.6.0 of the plugin. It's currently only available as a JAR on this repository (release section) - should be available soon to JMeter-Plugins.

Thanks a lot 😄 !

Hi @delirius325

Sorry about that, but I just tested with the 2.6.0 version, and it does exactly the same thing with a Debug Sampler:

java.lang.ArrayIndexOutOfBoundsException: 1
        at io.github.delirius325.jmeter.backendlistener.elasticsearch.ElasticSearchMetric.parseHeadersAsJsonProps(ElasticSearchMetric.java:206)
        at io.github.delirius325.jmeter.backendlistener.elasticsearch.ElasticSearchMetric.getMetric(ElasticSearchMetric.java:88)
        at io.github.delirius325.jmeter.backendlistener.elasticsearch.ElasticsearchBackendClient.handleSampleResults(ElasticsearchBackendClient.java:130)
        at org.apache.jmeter.visualizers.backend.BackendListener.sendToListener(BackendListener.java:267)
        at org.apache.jmeter.visualizers.backend.BackendListener$Worker.run(BackendListener.java:239)

@ncasaux

How odd, I'll look into it and release a minor version very soon. Sorry about that!

Hi @ncasaux ,

Sorry for the delay, I just got back from vacation.
Could you send me a sample JMX so that I could debug this issue faster?

Thanks,

Hi @delirius325 ,

I submitted a pull request to fix this issue, if you want to have a look. If you want to test, a test plan with just a "Debug Sampler" will do.