View source | Discuss this page | Page history | Printable version   

ERP/JMeter Performance Tests

Contents

Introduction

This document explains how to implement openbravo performance tests using JMeter.

JMeter

Apache JMeter is open source software, a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.

Install

In order to install, the recommended method is download the latest binary stable package from http://jakarta.apache.org.

wget http://www.trieuvan.com/apache/jakarta/jmeter/binaries/jakarta-jmeter-2.3.4.tgz
tar xvzf jakarta-jmeter-2.3.4.tgz -C /opt/

Execute

cd /opt/jakarta-jmeter-2.3.4/bin
jmeter

Blank window problem

If you get a blank window, this means that the window manager that you use is not compatible with the java awt toolkit that uses JMeter. In order to workaround this issue:

java $ARGS $JVM_ARGS -jar `dirname $0`/ApacheJMeter.jar "$@"
by:
export AWT_TOOLKIT=MToolkit
java $ARGS $JVM_ARGS -jar `dirname $0`/ApacheJMeter.jar "$@"
export AWT_TOOLKIT=MToolkit
export JAVA_HOME=/usr/lib/jvm/emul-linux-x86-java-1.6

$JAVA_HOME/bin/java $ARGS $JVM_ARGS -jar `dirname $0`/ApacheJMeter.jar "$@"

JMeter performance tests for Openbravo ERP 2.40

These tests have the objective to test the performance of specific functional flows in Openbravo ERP 2.40.

Prerequisites

For do that, after make login click on the user icon (top-left) and select the role "Openbravo Admin" and then click in "Set as default" check box. Click "OK".

Open the tests

For open JMeter with the 2.40 performance tests:

/opt/jakarta-jmeter-2.3.4/bin/jmeter -t 240perf_flows.jmx

Common elements

CommonElements.png

HTTP Header Manager

Defines common elements to all the generated http headers.

HTTP Request Defaults

Defines a default host and port for all the requests.

User Defined Variables

Defines the values for a set of id's of client, role, user, product.... needed to run the tests.
Also defines the time to fill a form, very useful to simulate the delay of the user to input the data.

Thread Group

Defines the number of users and loops for the tests.

Thread Group / HTTP Cookie Manager

Without this class we can't store the cookies after the login, so we will not been able to access any form of the application.

Thread Group / Aggregate Report

This report show the measured times (min, avg and max) of all the requests/tests.

Thread Group / "/jmeter_2.40/ad_forms/Role.html"

Note: "/jmeter_2.40" is the context name but is not the name use in the requests is only a label, for change the context in need to edit the context variable here
Going to role window and pressing ok button, we ensure that some temporary data and variables are reset.
For example, the first time we go to product window appear a search window, but the next times don't appear. Going to role window we ensure that always is the first time, so always appear the search window.

Thread Group / View Results Tree

In this page you can see all the requests and responses.
If you want to see all the data uncheck the "Only errors" check box.
The responses can be formated into a primary browser render, for facilitate the lecture.

One test in detail

Example: flow 4 - Search a Business Partner and switch to grid mode

Actions JMeter request config Response in View Result Tree Response in Browser
Go to the product page.
Flow4.1 BpEditViewEmpty.png
Tree flow4.1 BpEditViewEmpty.png
Browser flow4.1 BpEditViewEmpty.png
The first time that the product page is open it shows a search popup, we simply click ok.
Flow4.2 SearchPopup.png
As we don't select any BP, the first is selected by default
Flow4.3 BpEditViewSearch.png
Tree flow4.3 BpEditViewSearch.png
Browser flow4.3 BpEditViewSearch.png
We have to store in a variable the id of the BP that is selected, because we need when we change to grid mode to maintain the same BP selected. In order to archive this is used a regular expression that takes the bp_id from the html code of the previous response.
Flow4.4 RegularExpressionExtractor.png
Relation view
Flow4.5 BpRelationView.png
Tree flow4.5 BpRelationView.png
Browser flow4.5 BpRelationView.png
Gets the grid structure
Flow4.6 gridStructure.png
Tree flow4.6 gridStructure.png
Gets the grid data
Flow4.7 gridData.png
Tree flow4.7 gridData.png

Configuration

Host and port

HostPort.png

In HTTP Request Defaults introduce the server name and the port.

Id's

Variables.png

In User Defined Variables you have to check a lot of parameters:

Repetitions and users

LoopAndUsers.png

This is useful to repeat the test many times or simulate several user working concurrently.

When you do non-trivial load on the server the parameter Ramp-Up Period gets important to not start all simulated users at the same time.

Note: some test add records to the database so if one loop and one user adds one record, 10 users and 10 loop will and 100 records.

Execution

For clear the previous executions: Ctrl + e
To start the execution: Ctrl + r
For stop the execution: Ctrl + . (Ctrl + period)

Analysis Result

For see the analysis you can go the Thread Group / Aggregate Report.

AggregateReport.png

Interpreting the results

Be careful with the totals:


Avoid false results

ViewResultsTree.png

JMeter considers that the request is successful when the server returned something with an "HTTP 200" http status (200: OK. The request has succeeded). That means that when the host, port and context are available, probably request are successful instead of for example: you can not make login because the User/pass are wrong.

This can produce a excellent results in your test performance, but in reality the only things that are you receiving are errors. For this is important to check in Result Tree View that the responses are the expected.

Also you should check openbravo.log and catalina.out logs are free of errors related with the requests made by JMeter. Is usual if you have specified wrongs id's that some sql throws an error of malformed sql statement.

Add new test

The normal method to add a new test are setup a Http Proxy in JMeter and record all the request after that is needed to:

  1. Check that you only recorded the request you wanted (other open tabs), non primed cache.
  2. Replace all the possible parameters with variables (User defined Variables) as for example the context, ad_client_id, ad_role_id, etc.
  3. Change /openbravo (or your context) to ${context} in each request.
  4. Remove host/port from each request (if not your default is not used).
  5. Check the browser-derived headers entry recorded to each request, remove .completely if identical to the one in default, otherwise remove the individual identical lines and only keep special ones.
  6. Group requests into transactions with transaction controller.
  7. If the response contains the data needed to make a next request, it should be extracted with a regular expression.
  8. Add the inflow and between flow timers.

JMeter command line execution

Is possible to execute the tests without open the java interface, parameters:

-n : no gui
-t: test file
-l: log file in which store the execution results
/opt/jakarta-jmeter-2.3.4/bin/jmeter -n -t 240perf_flows.jmx -l jmeter240.log

Retrieved from "http://wiki.openbravo.com/wiki/ERP/JMeter_Performance_Tests"

This page has been accessed 5,683 times. This page was last modified on 21 February 2012, at 02:50. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.