Load testing OpenERP with JMeter

Introduction:

Apache JMeter is open source software, a 100% pure Java desktop application designed to load test functional behavior and measure performance.I am going to explain on load testing OpenERP with Jmeter.

Installation:

Download Apache Jmeter from,
http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi
Extract it
Go to jakarta-jmeter-2.4/bin
Run ./jmeter.sh(linux) or jmeter.bat (windows)

Procedure:

1) Right click on Test plan -> Add -> Threads -> Thread group

2) In the thread group, enter

Number of users:Number of users for which you are going to simulate the test.
Ramp-Up period: Number of seconds delay between user call.
Loop count: Number of times to repeat the test

3) Right click the new thread group -> Add -> Sampler -> SOAP/XML-RPC request. Rename it to XML-RPC Login.

Fill the fields,

URL: http://IP_ADDRESS:8069/xmlrpc/common
XML-RPC Data:

    <?xml version="1.0"?>
            <methodCall>
          <methodName>login</methodName>
          <params>
            <param>
                <value>DB_NAME</value>
            </param>
            <param>
                <value>USERNAME</value>
            </param>
            <param>
                <value>PASSWORD</value>
            </param>
          </params>
        </methodCall>

Note: Change IP_ADDRESS,DB_NAME, USERNAME and PASSWORD according to your real values.I assume XML-RPC of openerp listens at 8069, which is default.

4) Add another SOAP/XML-RPC request and name it as XML-RPC partners.

URL:http://IP_ADDRESS:8069/xmlrpc/object

<?xml version="1.0"?>
<methodCall>
  <methodName>execute</methodName>
  <params>
    <param>
        <value><string>DB_NAME</string></value>
    </param>
    <param>
<value>         <int>UID</int></value>
    </param>
    <param>
        <value><string>PASSWORD</string></value>
    </param>

    <param>
        <value><string>res.partner</string></value>
    </param>
    <param>
        <value><string>read</string></value>
    </param>

    <param>
      <array>
     <data>   <int>1</int>
  </data>
     <data>   <int>2</int>

</array>
    </param>

    <param>
      <array>
     <data>   <string>name</string>
  </data>
<data>   <string>title</string>
  </data>
</array>
 </param>
  </params>
</methodCall>

We are trying to read ‘name’ and ‘title’ from partners table, where id is in [1,2]. You can change/add according to your need.

5) Now time to put monitoring tools,

Right click on Thread group -> Add -> Listeners -> View Results Tree or Aggregate Graph or Aggregate report or Monitor Results or Graph results and so on.

6) Time to run the test now, Click Run -> Start from menu.
Click on each listeners and see the responses.

a)

b)

c)

Notes:

You can disable the login XML-RPC after the first time.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: