Seminar 4: Analyzing JMeter Log files and extracting performance metrics
Goal: In this practical exercise, you will learn to extract and estimate performance metrics from log files. By using these metrics, it is possible to understand the runtime behavior of a server component in a distributed system. We will use the CSV log files produced by JMeter. We will also learned to generate reports from log files using the modular dashboard extension of JMeter.
The log file: the CSV file produced by JMeter contains the following information.
- elapsed: Measures the elapsed time from just before sending the request, until just after the last chunk of the response has been received.
- threadName: Derived from the Thread Group name and the thread within the group. The name has the format groupName + " " + groupIndex + “-” + threadIndex where groupName - name of the Thread Group element, groupIndex- number of the Thread Group in the Test Plan, starting from 1, threadIndex - number of the thread within the Thread Group, starting from 1.
- Latency: Measures the latency from just before sending the request to just after the first chunk of the response has been received
- Connect: Measures the time it took to establish the connection
Files for this exercise:
Download the files:
- (File 1) captures the metrics from running three different algorithms (3 Classes) on a remote server - this was implemented in previous seminar
- (File 2) captures the metrics from remote load testing on a website
Exercise 1: Answer the following questions by analyzing file1.csv. What is the arrival rate of the three classes?. What is the average response time for each class? During the experiment, it is observed that the CPU is to be busy for 192 seconds. What is the utilization of the CPU? -- Refer to the slides for the formulas (40 marks)
Generating reports and graphs:
Reports can be easily generated from CSV files by using the following command.
./bin$ jmeter -g "location of the csv test" -o "output location for the report" .
The screenshot is shared for reference:
Exercise 2: Generate server reports of both the files - file1.csv and file2.csv using the JMeter as demonstrated above. What is the class that produced the highest workload in the server (file1.csv)? (30 marks)
To compare performance across different applications, Apdex (Application Performance Index) is used. Apdex is an industrial standard that provides insights about user satisfaction. By default, Apdex is configured with a threshold of 500 ms to analyze satisfaction. Naturally, user satisfaction can vary for specific applications. As a result, Apdex can be configured to analyze different thresholds. This threshold can be changed in the user.properties file that is located in the /bin folder of your JMeter setup.
# Change this parameter if you want to override the APDEX satisfaction threshold. # Set to 500 ms by default jmeter.reportgenerator.apdex_satisfied_threshold=100
Exercise 3: Change the APDEX satisfaction threshold and generate again a new report for both files. Use 100 ms as a new threshold. (30 marks)
Deliverables of practical session: Zip file containing the textual answers in PDF format, as well as the generated reports in Exercise 2 and 3.
In a real deployment: On a typical web server, you'll find Apache logs in /var/log/apache2/ then usually access.log , ssl_access.log (for HTTPS), or gzipped rotated logfiles like access-20210101.gz or ssl_access-20210101.gz. An entry in a web server log file looks as follows.
188.8.131.52 - - [03/Feb/2021:23:38:03 +0000] "GET / HTTP/1.1" 200 6763 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0"
Additional parsing is required over the entry, such that it can be used directly in report tool, such as the one provided by JMeter.