2013-01-25

BeanShell Server commands in Jmeter

In this article we are going to see the Bean Shell server commands which can be enabled. To enable BeanShell server command files , see my this post.

When we enable , following files are set to use for initialization. These are located in \bin directory.
BeanShellAssertion.bshrc
BeanShellFunction.bshrc
BeanShellSampler.bshrc

Note : In bin directory, we will see BeanShellListeners.bshrc also. The file contains sample definitions of Test and Thread Listeners. Not command to be installed. When ever we need to monitor listeners, we will need that.

Note :The Following functions will be installed Commonly for  
-BeanShellSampler.bshrc , BeanShellFunction.bshrc , BeanShellAssertion.bshrc

import org.apache.jmeter.util.JMeterUtils;
i = j = k = 0; // for counters
getprop(p) // get a JMeter property
{
    return JMeterUtils.getPropDefault(p,"");
}
getprop(p,d)// get a JMeter property with default
{
    return JMeterUtils.getPropDefault(p,d);
}
setprop(p,v)// set a JMeter property
{
    JMeterUtils.setProperty(p, v);
}
---Common ended---

When beanshell.sampler.init=BeanShellSampler.bshrc is enabled , following functions will be installed with functions from common section.

stopEngine()// Stop the JMeter test
{
    org.apache.jmeter.engine.StandardJMeterEngine.stopEngine();
}
stopThread(t)// Stop a JMeter thread
{
    org.apache.jmeter.engine.StandardJMeterEngine.stopThread(t);
}
String getVariables() // Create a listing of the thread variables
{
    StringBuffer myStringBuffer= new StringBuffer(100);
    Iterator i = vars.getIterator();
    while(i.hasNext())
    {
      Map.Entry me = i.next();
       if(String.class.equals(me.getValue().getClass())){
             myStringBuffer.append(me.toString()).append("\n");
       }
    }
    return sb.toString();
}
interrupt() // Interruptible interface
{
    print("Interrupt detected");
}

When beanshell.function.init=BeanShellFunction.bshrc is enabled , following functions will be installed with the functions mentioned in common section

stopTest()// to stop the test or the current thread
{
    org.apache.jmeter.engine.StandardJMeterEngine.stopEngine();
}
stopThread()// Stop current JMeter thread
{
    org.apache.jmeter.engine.StandardJMeterEngine.stopThread(Thread.currentThread().getName());
}
String fixAmps(s)// Fix ampersands in a string
{
  return s.replaceAll("&","&");
}
String fixAmpsInVar(String varname)
{
  return fixAmps(vars.get(varname));
}

When beanshell.assertion.init=BeanShellAssertion.bshrc is enabled , Common functions will be installed only.

Note : With the necessary of functions, we need to choose BeanShell Sampler file to initialize.

I will try to use BeanShell in my example section of jmeter so that it can be easy to understand.

..Thanks...:)

2013-01-21

Configuring JMeter Part 18 - jmeter engine and others

In this article we are going to see how can we configure jmeter by changing property of JMeter. In this section we will see the different settings for changing jmeter behavior in jmeter.properties file. This will be completing my full set of jmeter configuration posts.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad.

 -To stop controller accessing variables before creation (like old jmeter 2.0.3) UN-Comment this.
jmeterthread.startearlier=false

-To run PostProcessors revarse(like old times) Uncomment this
jmeterthread.reversePostProcessors=true

-To stop notifying listeners after run to access variables(like old behavior), uncomment this
jmeterengine.startlistenerslater=false

-To set time(ms) to wait for stopping a thread
jmeterengine.threadstop.wait=5000

-To invoke System.exit(0) in server exit code after stopping RMI
jmeterengine.remote.system.exit=false

-To call System.exit(1) on failure to stop threads in non-GUI mode.(If disabled, it may be necessary to kill the JVM externally)
jmeterengine.stopfail.system.exit=true

-To set pause time(ms) in the daemon thread before reporting that the JVM has failed to exit.
[If the value is <= 0, the JMeter does not start the daemon thread]
jmeter.exit.check.pause=2000

-To set jmeter listens 4445 port for shutdown message (non-GUI)[To disable, set the port to <=1000]
jmeterengine.nongui.port=4445

-To keep trying to reach a initial port on busy(non-GUI, To disable,set the value less than or equal to the .port property)
jmeterengine.nongui.maxport=4455

-To set time(ms) to check for shutdown during ramp-up
jmeterthread.rampup.granularity=1000

-To expand test plan tree on load [default false]
onload.expandtree=false

-To set max size of HTML page to display[default=200 * 1024, Set to 0 to disable the size check]
view.results.tree.max_size=0

-To disable JMS Point-to-Point Sampler from using the properties java.naming.security.[principal|credentials] when creating the queue connection.(un-comment this line)
JMSSampler.useSecurity.properties=false

-To enable/disable delete confirmation dialogue
confirm.delete.skip=false

-To set the size of document Cache(Web service Sampler (SOAP))
soap.document_cache=50

-To set the size of compiled scripts cache(JSR223 elements)
jsr223.compiled_scripts_cache_size=100

I will try to include more incrementally

...Thanks..:)

Configuring JMeter Part 17 - Mailer Model/Load sampler

 In this article we are going to see how can we configure jmeter by changing property of JMeter. In this section we will see the different settings for Mailer Model/Load sampler in jmeter.properties.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad.

----------------Mailer Model configuration-------
(It is kind of Listener, it will be useful if we integrate mailing system/logging )

-To set the number of successful samples before a message is sent
mailer.successlimit=2

-To set Number of failed samples before a message is sent
mailer.failurelimit=2

------------------- LDAP Sampler configuration----------------------------
-To set the Max number of search results to be sorted(0=turn off all sorting)
ldapsampler.max_sorted_results=1000

-To set the Number of characters to log for each of three sections (a value of 100 means a maximum of 300 characters of diff text will be displayed)
assertion.equals_section_diff_len=100
Note:A number of extra characters needed like "..." and "[[["/"]]]" which are used to decorate it.

-To set test written out to log to signify start/end of diff delta
assertion.equals_diff_delta_start=[[[
assertion.equals_diff_delta_end=]]]

I will try to provide example for this part.
...Thanks..:)


Configuring JMeter Part 16 - How to configure Cookie Manager?

In this article we are going to see how can we configure jmeter by changing property of JMeter. In this section we will see the different settings for Cookie Manager in jmeter.properties.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad.

-To Enable/Disable deleting null/empty Cookie  by Cookie Manager [Default is true]
CookieManager.delete_null_cookies=true

-To Enable/Disable variable cookies by Cookie Manager [ Default is true]
CookieManager.allow_variable_cookies=true

-To Enable/Disable save cookie as variables by Cookie Manager [Default is false]
CookieManager.save.cookies=false

-To set prefix with cookie name before storing by Cookie Manager [Default is COOKIE_]
CookieManager.name.prefix=COOKIE_

-To Enable/Disable checking validity of a cookie before saving by Cookie Manager[Default is true]
CookieManager.check.cookies=true

...Thanks..:)

Configuring JMeter Part 15- Summary Results in Non GUI Mode

 In this article we are going to see how can we configure jmeter by changing property of JMeter. In this section we will see the different mode settings for Summary Results in Non GUI Mode in jmeter.properties.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad.

-To set the name for automatically start(in Non-GUI)
summariser.name=summary
 
-To set interval(second) between summaries [Default 3 min]
summariser.interval=180

-To enable write messages to log file
summariser.log=true

-To enable write messages to System.out
summariser.out=true

....Thanks....:)

Configuring JMeter Part 14 - CSV Read/Data Set/Time

 In this article we are going to see how can we configure jmeter by changing property of JMeter. In this section we will see the different mode settings for CSVRead , Data Set and Time in jmeter.properties.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad.

- to  set the separator  characters, or these will be included in the list of valid delimiters
csvread.delimiter=,
Note: Default is Comma ",". Other values are ; , !, ~, \t

-To set a String to return at EOF (if recycle not used)
csvdataset.eofstring=

-To define the default formats of _time() configuration.
time.YMD=yyyyMMdd
time.HMS=HHmmss
time.YMDHMS=yyyyMMdd-HHmmss
time.USER1=
time.USER2=

...Thanks..:)

2013-01-20

Configuring JMeter Part 13 - Path and Properties

In this article we are going to see how can we configure jmeter by changing property of JMeter. In this section we will see the different mode settings for class path and properties in jmeter.propertie.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad.

----------------------- Classpath configuration-------------------------------
-To define for searching jmeter Extensions(Do not use this for utility jars, ). These are just addional to default lib/ext.
search_paths=/app1/lib;/app2/lib

-To define additional class path for utility jars or JUnit test cases
user.classpath=../classes;../jars/jar1.jar


-To specify the class finder for GUI/Non GUI mode classes.
classfinder.functions.contain=.functions.
classfinder.functions.notContain=.gui.
[ Comment those if there any problem
Note : The classpath finder currently needs to load every single JMeter class to find the classes it needs.For non-GUI mode, it's only necessary to scan for Function classes, but all classes
are still loaded. In here, I used , .gui for GUI mode classes and .function Non-Gui Mode.]

-----------------------Additional property files to load-----------------------------
-To set additional properties . we can change by wither editing those property file or assign those property with our custom property file and assign them here.
user.properties=user.properties
system.properties=system.properties

[Note, if we assign those, it will look for it, if not(disabled), this two file will be ignored]

... Thanks...:)

Configuring JMeter Part 12 - BeanShell Server

In this article we are going to see how can we configure jmeter by changing property of JMeter. In this section we will see the different mode settings for TCP Sampler in jmeter.propertie.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad. Search for tcp sampler section in notepad and get the following.

For primary idea on BeanShell Server, please follow the structure here and if you interested in an example server, you may see this. It can be used while running test remotely. 

-To Define the port number as non-zero to start the http BeanShell Server on that port
beanshell.server.port=9000
[Note : The telnet server will be started on the next port]

-To Set the server initialization file(in path)
beanshell.server.file=../extras/startup.bsh

-To Define a file(path) to be processed at startup
beanshell.init.file=
[Path is not given, it will use own interpreter]

-To set the initialization files for BeanShell Sampler, Function and other BeanShell elements
beanshell.sampler.init=BeanShellSampler.bshrc
beanshell.function.init=BeanShellFunction.bshrc
beanshell.assertion.init=BeanShellAssertion.bshrc
beanshell.listener.init=etc
beanshell.postprocessor.init=etc
beanshell.preprocessor.init=etc
beanshell.timer.init=etc
[Note : Beanshell test elements do not share interpreters. Each element in each thread has its own interpreter. This is retained between samples.The file BeanShellListeners.bshrc contains sample definitions of Test and Thread Listeners. ]

...Thanks..:)

Configuring JMeter Part 11-How to configure TCP Sampler?

In this article we are going to see how can we configure jmeter by changing property of JMeter. In this section we will see the different mode settings for TCP Sampler in jmeter.propertie.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad. Search for tcp sampler section in notepad and get the following. 


-To set default handler class
tcp.handler=TCPClientImpl

-To set byte value 111 for end of line[it will be from -128 to +127]
eolByte = 111
-To set this to a value [outside the range -128 to +127] (to skip eol checking)
tcp.eolByte=1000

-To set  TCP Charset
tcp.charset=
[Note : It is used by org.apache.jmeter.protocol.tcp.sampler.TCPClientImpl default to Platform defaults charset as returned by Charset.defaultCharset().name().]

-To set status.prefix(start with the string, in here Status=) and suffix (strings for enclose the status response code, in here Full stop.)
tcp.status.prefix=Status=
tcp.status.suffix=.


-To specify status.properties (property file to convert codes to messages)
tcp.status.properties=mytestfiles/tcpstatus.properties

-To set length prefix (for LengthPrefixedBinaryTCPClientImpl implementation)[2 is default]

tcp.binarylength.prefix.length=2

Note : In that part, I could not use all. I will try this with an example later on.

..Thanks..:)

Configuring JMeter Part 10 - How to configure batch processing?


In this article we are going to see how can we configure jmeter by changing property of JMeter. In this section we will see the different mode settings for batch processing in jmeter.propertie.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad.

-To set Sample sender configuration [true = client (default), false=server]
sample_sender_client_configured=true

-To set remote batching support
 mode=Standard
[Other values : 
Standard= returns each sample synchronously(default)
Hold = retains samples until end of test (need memory)
Batch = returns samples in batches
Statistical = returns sample summary statistics
Spatial combined values : Stripped, StrippedBatch.
 StrippedBatch mode will remove some data from the SampleResults as the response body and it will send Sample Results as Batches (low resource using) ]

 -To load a class of an implementation of org.apache.jmeter.samplers.SampleSender
mode=org.example.load.MySampleSender

-To Set key statistical samples on threadName (false for threadGroup)
key_on_threadname=true

[DiskStore: For Hold mode, but serialises the samples to disk, rather than saving in memory]
mode=DiskStore
Note: the mode is currently resolved on the client, other properties (e.g. time_threshold) are resolved on the server.

-To set for holding samples up to 100
hold_samples=true
num_sample_threshold=100

-To set threshold time(ms)
time_threshold=60000

[Asynchronous sender: To use a queue and background worker process to return the samples]

-To set queue size to 100 [Asynch Mode]
asynch.batch.queue.size=100

-To set the Monitor Health Visualizer buffer size to 800
monitor.buffer.size=800

...Thanks..:)

2013-01-19

Configuring JMeter Part 9 - How to configure Parsers?

In this article we are going to see how can we configure jmeter by changing property of JMeter. In this section we will see the different type of Parsers' settings in jmeter.propertie.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad.

--------- HTTPSampleResponse Parser configuration/Parser selection---------
-To set the parsers [Space-separated list of parser groups]
HTTPResponse.parsers=htmlParser wmlParser

---------- HTML Parser configuration----------
-To set HTML parser Class Name
htmlParser.className=org.apache.jmeter.protocol.http.parser.HtmlParserHTMLParser
[Note : This is Default parser, Other parsers:
org.apache.jmeter.protocol.http.parser.JTidyHTMLParser
org.apache.jmeter.protocol.http.parser.RegexpHTMLParser]

-To set pursing file type
htmlParser.types=text/html application/xhtml+xml application/xml text/xml

------------WML Parser configuration------------
-To define pursing class(we can use our own developed purser class)
wmlParser.className=org.apache.jmeter.protocol.http.parser.RegexpHTMLParser

-To set pursing file type(default, text type, vnd.wap.wml)
wmlParser.types=text/vnd.wap.wml 

... Thanks...:)

Configuring JMeter Part 8 - Proxy Server Configuration

In this article we are going to see how can we configure jmeter by changing property of JMeter. In this section we will see the Proxy Server settings in jmeter.propertie.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad.

-To set domain for command-line flags [with user-name and password]
http.proxyDomain=NTLM domain
[If required by HTTPClient sampler],Example :
http.proxyDomain = RELISOURCE
[This is my company domain name]

-To set SSL configurations
proxy.cert.directory=.
proxy.cert.file=proxyserver.jks
proxy.cert.type=JKS
proxy.cert.keystorepass=password
proxy.cert.keypassword=password
proxy.cert.factory=SunX509
proxy.ssl.protocol=SSLv3

Note : to manage keystore file(.jks) we can use a free tool from here.

..Thanks...:)

Configuring JMeter Part 7 - Recorder Proxy Configuration


In this article we are going to see how can we configure jmeter by changing property of JMeter. In this section we will see the Recorder Proxy settings in jmeter.propertie.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad. We can find various properties which are activated and some are not yet activated.

-To set gap between HTTP requests while recording (Unit in MS)
proxy.pause=1000

-To add numeric prefix Sampler names (Number of steps like 1,2) [default false]
proxy.number.requests=true

-To set default HTTP Sampler (currently HttpClient4)
[Other Values = HTTPSampler, Java, HTTPSampler2, HttpClient3.1]
jmeter.httpsampler=HttpClient4

-To set content-type include filter to use(recording filter which will be recording)
proxy.content_type_include=text/html|text/plain|text/xml
[all used as OR here, we can also use one of the like text/html]

-To set content-type exclude filter to use(recording filter which will not be recording)
proxy.content_type_exclude=image/.*|text/css|application/.*
[all used as OR here, we can also use one of the like image/jpg]

-To set Default headers to remove from Header Manager elements
[Cookie and Authorization Manager are always removed]
proxy.headers.remove=If-Modified-Since,If-None-Match,Host
[Note : We can also use any one option also]

-To set binary content-type handling(by saving the request in a file)
proxy.binary.types=application/x-amf,application/x-java-serialized-object
-To set directory(The files will be saved in this)
proxy.binary.directory=user.dir
-To set file suffix(Files will be created with this filesuffix)
proxy.binary.filesuffix=.binary

To be noted, this is the proxy used for recording(local machine proxy server)

...Thanks...:)

2013-01-18

Configuring JMeter Part 6 - HTTP/HTTPS or other Protocols?

In this article we are going to see how can we configure jmeter by changing property of JMeter.
Jmeter has many of properties. In this section we will see the protocol settings in jmeter.propertie.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad. We can find various properties which are activated and some are not yet activated.

------HTTPS/SSL Section---
- To enable/Disable SSL session sharing
https.sessioncontext.shared=true

-To set Default HTTPS protocol level
https.default.protocol=TLS
Note : we can set  SSLv3 here

-To Enable multiple HTTPS protocols (Careful before doing):
https.socket.protocols=SSLv2Hello SSLv3 TLSv1

-To reuse cache in SSL[false will reset cache]
https.use.cached.ssl.context=true

-To set Start/End index for keystores with many entries[Default is 0]
https.keyStoreStartIndex=0
https.keyStoreEndIndex=0


------HTTP Section---

-To set retry 3 times of HTTP Java sampler
http.java.sampler.retries=3

-To define Http Client parameters (Commons/Apache)
httpclient.parameters.file=httpclient.parameters
hc.parameters.file=hc.parameters
[Note : See httpclient.parameters/hc.parameters file in bin folder]

-To set the socket timeout 200(ms)[No time out is 0]
httpclient.timeout=200

-To Set the http version [defaults to 1.1]
httpclient.version=1.0

-To Define characters per second [Grater 0 to emulate slow connections]
httpclient.socket.http.cps=0
httpclient.socket.https.cps=0

-To enable loopback
httpclient.loopback=true

-To Define the local host address to be used for multi-homed hosts(multi agent running)
httpclient.localaddress=1.2.3.4

-To set retry count on http 3 or 4 
httpclient3.retrycount=1
httpclient4.retrycount=1

..Thanks...:)...

Configuring JMeter Part 5 - How to configure Results?

In this article we are going to see how can we change property of JMeter.
Jmeter has a very big number of properties. In this section we will see the result / report settings mention in jmeter.propertie.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad. We can find various properties which are activated and some are not yet activated.

-To set results file type(xml/csv)
jmeter.save.saveservice.output_format=xml

-To set encoding (default ISO-8859-1)
sampleresult.default.encoding=ISO-8859-1

-To set saving parameters [True parameters will be saved]

jmeter.save.saveservice.assertion_results_failure_message=false[Only for CSV]
jmeter.save.saveservice.assertion_results=none
jmeter.save.saveservice.data_type=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.response_code=true [Not for CSV]
jmeter.save.saveservice.response_data=false [Save Response Data on fail]
jmeter.save.saveservice.response_data.on_error=false
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.subresults=true
jmeter.save.saveservice.assertions=true
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.samplerData=false
jmeter.save.saveservice.responseHeaders=false
jmeter.save.saveservice.requestHeaders=false
jmeter.save.saveservice.encoding=false
jmeter.save.saveservice.bytes=true
jmeter.save.saveservice.url=false
jmeter.save.saveservice.filename=false
jmeter.save.saveservice.hostname=false
jmeter.save.saveservice.thread_counts=true
jmeter.save.saveservice.sample_count=false
jmeter.save.saveservice.idle_time=false
jmeter.save.saveservice.timestamp_format=yyyy/MM/dd HH:mm:ss.SSS[our choice]
jmeter.save.saveservice.default_delimiter=\t[For TAB character separator for CSV, a comma , is also accepted]
jmeter.save.saveservice.print_field_names=false [CSV only]

-To see results with Nano Second Parameter
sampleresult.useNanoTime=true

-To disable the background thread[result threads]
sampleresult.nanoThreadSleep=-1
Note: Values >=0 will keep the thread sleep (Nano Second Unit.)

-To Save the start time stamp (Instead of the end)[Effective for result files also]
sampleresult.timestamp.start=true

-To save list variable names with values in the result data files, we use commas to separate the names.
sample_variables=SESSION_ID,REFERENCE
[Note :  Currently it saves the values in XML as attributes,so the names must be valid XML names]

-To set network response size in calculation method
Note : Size = Number of bytes for response body return by web server. If it is false, the (uncompressed) response data size will used (default before jmeter 2.5)
Include headers: Add the headers size in real size
sampleresult.getbytes.body_real_size=true
sampleresult.getbytes.headers_size=true

-To set Prefix to identify file names that are relative to the current base
jmeter.save.saveservice.base_prefix=~/

This will be long post as all specification depends on client. I will try to add more from further experiences. 

..Thanks...:)

Configuring JMeter Part 4 - How to configure Logs?

In this article we are going to see how can we change property of JMeter.
Jmeter has a very big number of properties. In this section we will see the Log settings mention in jmeter.propertie.

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad. We can find various properties which are activated and some are not yet activated.

For primary log format, see this
If we change the default format property, it will be change.
Default format:
log_format=%{time:yyyy/MM/dd HH:mm:ss} %5.5{priority} - %{category}: %{message} %{throwable}

- To set the log level up to package/class
log_level.[package_name].[classname]=[PRIORITY_LEVEL]

Example :
log_level.jmeter=INFO
log_level.jmeter.junit=DEBUG
log_level.jmeter.control=DEBUG
log_level.jmeter.testbeans=DEBUG
log_level.jmeter.engine=DEBUG
log_level.jmeter.threads=DEBUG
log_level.jmeter.gui=WARN
log_level.jmeter.testelement=DEBUG
log_level.jmeter.util=WARN
log_level.jmeter.util.classfinder=WARN
log_level.jmeter.test=DEBUG
log_level.jmeter.protocol.http=DEBUG
[For Cookie/Auth manager]
log_level.jmeter.protocol.http.control=DEBUG
log_level.jmeter.protocol.ftp=WARN
log_level.jmeter.protocol.jdbc=DEBUG
log_level.jmeter.protocol.java=WARN
log_level.jmeter.testelements.property=DEBUG
log_level.jorphan=INFO

-To categorize a log file
log_file.[category]=[filename]
[Note : Category is like package/class like above]

-To logs separately for Jmeter and Jorphan
log_file.jorphan=jorphan.log
log_file.jmeter=jmeter.log

-To log Combined(jmeter + jorphan)
log_file=jmeter.log

-To define formats in the JMeter LoggingManager
log_format_type=default [ thread_prefix/thread_suffix]
-thread_prefix adds the thread name as a prefix to the category
-thread_suffix adds the thread name as a suffix to the category
Note: Thread name is not included by default, as it requires extra processing.

----Spatial Logging for HttpClient------------
Commons HttpClient Logging information can be found at here.
-To set log level
log_level.org.apache.commons.httpclient=debug

-To log Authenticator
log_level.org.apache.commons.httpclient.Authenticator=trace

-To Show headers only
log_level.httpclient.wire.header=debug

-To set separate file for wire debug
log_level.httpclient.wire=debug
log_file.httpclient=httpclient.log

-To Enable header wire + context logging[Best for Debugging]
log_level.org.apache.http=DEBUG
log_level.org.apache.http.wire=ERROR

-To Enable full wire + context logging
log_level.org.apache.http=DEBUG

-To Enable context logging for connection management / request execution
log_level.org.apache.http.impl.conn=DEBUG
log_level.org.apache.http.impl.client=DEBUG
log_level.org.apache.http.client=DEBUG

...Thanks..:)

Configuring JMeter Part 3 - How to configure Hosts&RMI?


In this article we are going to see how can we change property of JMeter.
Jmeter has a very big number of properties. In this section we will see the RMI settings mention in jmeter.propertie.

 In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad. We can find RMI properties which are activated and some are not yet activated.

- To define remote host[we have to use IP for remote]
remote_hosts=127.0.0.1
Example For Multiple Hosts
remote_hosts=localhost:1099,localhost:2010
[With Port, multiple assign]
remote_hosts=192.168.1.28:1099,192.168.1.54:1099
[Different workstations ]

-To define RMI port to be used by the server (must start rmi registry with same port)
server_port=1099
-To Change the port to 5555
- set server_port=5555
- start rmiregistry with port 5555
For windows
SET SERVER_PORT=5555
JMETER-SERVER
For Unix:
SERVER_PORT=5555 jmeter-server
On the client:
- set remote_hosts=server:5555

-To set RMI port used by the RemoteSampleListenerImpl[Default 0 means randomly assigned]
client.rmi.localport=0

-To use a specific port for the JMeter server engine(before starting the server)
server.rmi.localport=5555

-To change the default port (1099) used to access the server:
server.rmi.port=1234

-To stop the server creating the RMI registry:
server.rmi.create=false

-To exit after the first test
server.exitaftertest=true

-To start mirror server on the port
mirror.server.port=8081

Thanks..:)

2013-01-17

Configuring JMeter Part 2 - How to configure HTTP sampler?

In here we are going to see the continuation of  configure JMeter post. We will see how to change settings of HTTP sampler .

In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad. We can find various properties which are activated and some are not yet activated. If we change settings by editing following.

-To set Max redirects in a single sequence[default 5]
httpsampler.max_redirects=5

-To set Max frame/iframe nesting depth[default 5]
httpsampler.max_frame_depth=5

-To set Max await timeout (sec) when concurrent download embedded resources (default 60)
httpsampler.await_termination_timeout=60

-To set no separate container for embedded resources
httpsampler.separate.container=true

-To set ignore download fails
httpsampler.ignore_failed_embedded_resources=false

Thanks..:)

2013-01-16

How to distribute test in jmeter?

In this article we are going to see how to distribute test in JMeter. Basically what we do, we will distribute out single test plan to run in distributed way.

First, We have to know how JMeter works in single PC. JMeter creates an agent to a PC and the agent executes test which we have prepared. So, What will be done in the distributions? In the distributed way, jmeter will run the same test plan from different pc where the control will be on one. That means, 1 Master  but several servers(or remote).

Step 1 : Prepare a test plan
We have to make a test plan to test. You can you any plan to do that, I have use an example from previous post.

Step 2 : Prepare the System to Test

a. Prepare Server (Remote hosts)
-Go to JMeter installed folder , /bin directory and execute jmeter-server.bat
[Note: if we don't see cmd prompt, we have to show the path of JRE path manually in jmeter-server.bat, to do that, open this jmeter-server.bat by text editor and find :setCP,
edit “START rmiregistry” to the full path.(Ex: “START C:\\jre\bin\rmiregistry”)


b. Prepare Master
-Open jmeter.properties in a text editor
-Edit line “remote_hosts=127.0.0.1”(Ex-remote_hosts=192.168.0.10,192.168.0.11,192.168.0.12)
-start jmeter.bat
-Open the test plan that we have saved
Note :
-All Server and Master should be in same sub net mask(same network)

Step 3 : Run The Test
 -Check Server
If  we want to check the slave systems that are working, open jmeter.log in notepad and we can see this entry.
Jmeter.engine.RemoteJMeterEngineImpl: Starting backing engine

- Running in a Single Server
 Click Run-> Remote Start -> IP(select destination server IP)
- Running all servers
Click Run-> Remote Start All

See the screenshots  for more options.


Notes :
1. Run All same version of  jmeter in server and master pc.
2. RMI can't Run without proxy server, so we need a proxy server to use centrally.(I will provide a different test plant for better understanding later on)
3. As JMete works with large data over network, it is better not to have so many listeners, but we need simple logger to view results after finishing the test process.
4. If we execute using 2/3 server, the Master will be very busy on collection data. We might need a high configured Master to solve the problem. So, for a small solutions, it is better not to use distribute testing.
5. For, configuration estimation(from jmeter site), a 2.3Ghz CPU can take 300-600 threads(depends on test type )except for XML pursing test(such as web service test). XML purse test will be 4-10 time slower than normal steps.
6. Stop All antiviruses (it stops high resource using)[I am using windows]
7. Stop internet connection Firewall [I am using windows]

So , that is a small demonstration for a distributed test execution in Jmeter. We need when we are testing a large amount of load.

...Thanks..:)