Site icon Vinsguru

JMeter – Centralized Logging Solution in Distributed Testing using ElasticSearch + Beats + Kibana

I would like to show you the Centralized Logging Solution Architecture design for JMeter distributed performance testing in this article.

Distributed Testing Challenges:

In JMeter distributed testing we might face below challenges. TestAutomationGuru has already given the solutions for these challenges using Open Source tools/technologies.

Real Time Response Data Monitoring:

When we do a load test using JMeter in Non-Gui mode, we could collect the real time performance test result metrics & application server metrics as shown below, with the help of InfluxDB + Grafana. Even though Grafana dashboard can show the number of requests passed vs failed etc, we might want to know why it failed.

All the failed requests might not be due to HTTP Response code 500. Sometimes, the HTTP Response codes for the failed requests can still be 200. For example, Response Data Assertion simply checks if the given string is present in the Response Data or not. If it is not present, It fails the request which is fine. But what the response data we actually got during that time? It could be very important to know that to debug the application behavior during the performance test.

We often use Cloud / Remote machines to run the performance tests. Even if we log the response data in a log file, we might not be able to get the data immediately. We might want to wait for the performance test to complete to access the machine to check the logs. We can not collect these huge String in the InfluxDB as we did for the performance test result metrics as it is basically not designed for that purpose.

One of the neat solutions is to analyze, the application response data for failed requests, using ElasticSearch + File Beats + Kibana.

 

Infrastructure Setup:

2016/12/13 08:16:06 INFO - jmeter.threads.JMeterThread: Stopping: Thread Group 1-5
2016/12/13 08:16:06 INFO - jmeter.threads.JMeterThread: Stopping: Thread Group 1-1
2016/12/13 08:16:06 ERROR - kg.apc.jmeter.timers.VariableThroughputTimer: Waiting thread was interrupted java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at kg.apc.jmeter.timers.VariableThroughputTimer.delay(VariableThroughputTimer.java:78)
at org.apache.jmeter.threads.JMeterThread.delay(JMeterThread.java:771)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:424)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
at java.lang.Thread.run(Unknown Source)

 

multiline.pattern: ^[0-9]{4}/[0-9]{2}/[0-9]{2}(starting with time stamp)

 

That is it! Restart filebeat.exe.

FileBeat will start monitoring the log file – whenever the log file is updated, data will be sent to ElasticSearch. Using Kibana we can monitor the log entries in ElasticSearch.

JMeter Test:

I create a very simple test as shown below. I have only Debug Sampler. Instead of using Response Assertion, I use JSR223 Assertion – to write more information in the log file in case of any error.

Lets run the test.

The test keeps writing below information in the log file.

At this point, FileBeat will start collecting the information from the log file and forward to ElasticSearch which we can see through Kibana.

 

If we click on the small arrow to expand the details, message section below will show the actual data we are interested in.

 

Centralized Logging Solution Architecture:

Summary:

Along with Real-Time performance test results, we are also able to collect the HTTP response data for the failed requests real time. The above setup is extremely helpful when we do a long-running distributed load testing in the cloud. When the requests suddenly started failing, This setup helps us to check the HTTP response data to understand the application and test behavior.

 

Happy Testing & Subscribe 🙂

 

 

Share This:

Exit mobile version