2013-05-11

Introduction to JMeter Google PlugIn- Sampler

In this article we are going to see what are additional features/items added after installing jmeter plugin (Google Plugin) and what we can do with it. I will discuses about Samplers only. To know about basic of jmeter see my this page. And, the process to install plug in , see this post.

 After installing Google plug in, it installs 11 type of Samplers in Jmeter.To add a sampler to test plan, -Right click a Thread > Listeners > [Name of the Sampler]

1. jp@gc - Dummy Sampler
-This sampler do not provide request to real server, just provide dummy response data. Dummy Sampler used to simulate requests and responses without actual network activity

-We have provide manual request/response data inside this sampler which can be seen from response data on View Result Tree Listener
-Response/request data should be in html format.
-We can define latency time  and response to simulate actual scenario.
-We can make success/fail type of sample.
-This is very useful sampler when we need to verify any post processor script(beanshell/Regular expression etc)
-When we need to simulate false requests for proving the test plan and report , it is very useful.

2. jp@gc - Hadoop Job Tracker Sampler
- This need spatial plugin library to be installed. Download link is here. Keep the files in \apache-jmeter-2.9\lib directory
-We have to put job tracker URL in mapred.job.tricker
-We can get Hadoop JOB counters/JOB state/task level/task state by using JOB id or JOB counter group name.
-We will get response data in XML format 

Note : I have not used that sampler in real project. I can add more comments when I will get a chance to use this.

3.jp@gc - HBase CRUD Sampler
- This need spatial plugin library to be installed. Download link is here. Keep the files in \apache-jmeter-2.9\lib directory
 -It provide the CRUD operation over HBase database. Basically we can perform add/update/delete operation with data
-We need provide hbase.zookeeper.quorum as URL, table, raw key
-We have to set operation mode and operation type with data.

Note : I have not used that sampler in real project. I can add more comments when I will get a chance to use this.

4. jp@gc - HBase Rowkey Sampler
- This need spatial plugin library to be installed. Download link is here. Keep the files in \apache-jmeter-2.9\lib directory
-Rowkey sampler is used to retrieve a specific record with a rowkey of the hbase table
-This need a jp@gc - HBase Connection Config to set the connection.
-We need to add connection name(should exist in config), table name, and RowKey. We can define to retrieve updated data.
-We can create variable from retried data and use in test plan  

Note : I have not used that sampler in real project. I can add more comments when I will get a chance to use this.

5. jp@gc - HBase Scan Sampler
- This need spatial plugin library to be installed. Download link is here. Keep the files in \apache-jmeter-2.9\lib directory
-Scan sampler is used to retrieve single/multiple record with rowkeys or filter from hbase table
-Filter format should be - {column_family}:{qualifier}{= | != | < | > | <= | >=}{value}
Ex-NAME: Entry_Name = Shantonu
-Start and End key are optional.
-Like as Rowkey sampler, it need HBase connection config and table/connection name.
-We can provide limit of data(numeric value)

 Note : I have not used that sampler in real project. I can add more comments when I will get a chance to use this.

6. jp@gc - HDFS Operations Sampler
- This need spatial plugin library to be installed. Download link is here. Keep the files in \apache-jmeter-2.9\lib directory
-This is Hadoop Distributed File System specific sampler used for storing any file or data from local storage to HDFS directory.
-The input destination = local file path with name
-Output destination on HDFS = out put path
-Name code = htfs URL
-Name and location of the file or error message comes as Response of this sampler.

7. jp@gc - HTTP Raw Request
 -This is very handy sampler over default HTTP Request as it sends the raw request. It's a raw version of default http request.
-Like default http request, we need to define all inputs along with request data. We may add data file path. 
-The load generators will need less resource to handle this sampler. So, for handling large files, we will not face un-wanted out of memory exception.
-It supports capturing latency time separately than response time.
-We can limit response data stored in results which cause low memory. We can set this from user.properties file with this .
 kg.apc.jmeter.samplers.ResultDataLimit
Response will get all data(so, test is ok) but not all data will be saved. 
-As it is a implementation of RAW TCP sampler, we can test non-http servers also.
-Default buffer length is 4k, to change this set this in bytes at user.properties file kg.apc.jmeter.samplers.ReceiveBufferSize
Draw back- In GUI mode, it is not possible to add raw data, but, if we can use Raw data source pre processor and define a raw data stored file,the limitation is easily overcome.

My opinion, you should use this in large scale application testing. And, you can specify response time and latency time related problems very specifically.

8.jp@gc - JSON to XML Converter
- This need spatial plugin library to be installed. Download link is here. Keep the files in \apache-jmeter-2.9\lib directory
-This is a spatial sampler that converts a JSON text to XML along with XML format post processor.
-We get a XML as response data of that JSON text.
-It is used in case we need our custom JSON to be processed in to XML and use it as variable.

9.jp@gc - OAuth Sampler
-This sampler follow OAuth protocol to use token(instead of credentials) for getting data hosted by a given service provider. Actually, this token grants access for specific resources for defined period of time.
-It is an extended REST sampler, so all input of REST will be there added with customer key and customer Secret
-Very useful with stored token IDs in a file to run test for a specific time.(we can use token as variable)

10.jp@gc - REST Sampler
-This is a REST request which is widely use for testing SOAP services. It uses XML payload to send to SOAP.
-Methods are GET, POST, PUT, DELETE
-Resource is the child path of URL
-Headers depends on what you use(to get browser related issues)
-Body : Use XML formatted request which will be send.
-This sampler is a far better than using  WebService(SOAP) Request (DEPRECATED) or SOAP/XML-RPC Request

11.jp@gc - UDP Request
- This sampler is based on User Diagram Protocol .
- It can be used for both way communication.
- It follows 3 embedded classes for encode and decode. We have to define any one in input. 
kg.apc.jmeter.samplers.HexStringUDPDecoder
kg.apc.jmeter.samplers.DNSJavaDecoder
kg.apc.jmeter.samplers.UDPSampler

When we need binary packed data, we can use these classes to convert GUI data to binary data or convert response data in to readable format text.
-In case of custom UDP based application, we may need to make own converter classes. For this we need to implement this interface (to be able to use with UDP request).  kg.apc.jmeter.samplers.UDPTrafficDecoder
-With this we can load test DNS, NTP, TFTP, API, custom chat server, Boot servers and other systems(even non standard).

-It has standard buffer limit of 4k, to change , use this in byte in user.properties 
 kg.apc.jmeter.samplers.ReceiveBufferSize =

Note : I have not used that sampler in real project. But, I am going to make separate post on this when I will start Jmeter Extended posting(making application specific jmeter).

Thanks...:) 

2013-05-10

Introduction to JMeter Google PlugIn- Listeners

In this article we are going to see what are additional features/items added after installing jmeter plugin (Google Plugin) and what we can do with it. I will discuses about Listeners only. To know about basic of jmeter see my this page. And, the process to install plug in , see this post.

What is a listener? A listener mainly analysis the monitored data and show in different way about different information. You may see my previous post to know more about listeners. So, after adding the Google plug in, we get 19 type of listeners. Well, it is better to use these listeners as they are very memory efficient. All listeners can be added
-Right click a Test Plan or thread > Listeners > [Name of the listener]

And, for most of the cases, add  "Save active thread counts" from listener's configuration(if it is present)

1. jp@gc - Active Threads Over Time
-This shows the threads running or ran over time. It is a simple listener showing how many active threads are there in each thread group during test run.
-A single listener can show different threads(if it is in directly under test plan),  Please make sure that you change the label of the thread to distinguished between them.
-Make sure to Tick the "Save Active Thread Count" in listener's configuration to
-In case of remote testing (multiple servers) make the thread group label with name of the remote pc to identify. Ex- ${__machineName()}_myThreadName. This function will call the remote pc name and attach with thread group.
-It is very useful while running the test, we can see the overall and individual thread progress. In my opinion, if there is small user generation or you need a demo run to show to your clients, you must add this to see the overall progress.
See a sample screen shot.

2. jp@gc - AutoStop Listener
-This is a spatial listener who will check certain conditions to stop the test. Like as conditional test terminator.
-Functionally, if condition verify, It will trigger shutdown test (up to 5 attempts) . If shutdown test  can not stop, it will trigger stop test(up to 5 attempts). If stop test can not stop, it will trigger stop now.
-Provide value Zero to any criteria if we want to disable.

3. jp@gc - Bytes Throughput Over Time
-This shows Bytes send or receive over time. All units are in second.
See a sample screen shot.

4. jp@gc - Composite Graph
-This is a spatial listener. It shows any graph from other listeners. In graph section, we can select/deselect from available sources.
-It works if we add that before test run.
-It is very useful see different graphs together in composite/combined way. So that we can compare different states.
-It is very useful while analyzing the data with graph representation
See a sample screen shot.

5. jp@gc - Console Status Logger
-This shows summary log in command prompt while Jmeter is running in Non GUI mode.
-This write summary log in log file while Jmeter is running in GUI mode.
See a sample screen shot.

6. jp@gc - DbMon Samples Collector
-This listener shows performance counters provided by database(some data base provides) when the test running(using SQL).
-It also can put values in to database which are accessible.
-We must follow a DB test plan process to make this listener workable. (like as adding JDC connection configuration)
-When we add a single line in the listener, it contains 4 properties.
JDBC pool variable name : It is the variable name which can be used in the test plan.
Chart Label : This is the label which will be shown in the chart representing the value.
Delta : [I do not know yet]
SQL Query : The query which will be used. This must return single numeric value(single column, single row and numeric data)
-Generally, sql query get the value in every second. If we need to change the interval, we may put
jmeterPlugin.dbmon.interval = [millisecond time ] this property in user.properties.
Note : I have not used that yet, so, when I will use this, I can put more comments.

7. jp@gc - Flexible File Writer
This is same as Sample Data writer, but in more flexible format and I has a GUI.
-It has a header and footer
-We need to specify the file path.
-We can specify data for each sample record
-We can use available fields to include as data. Add are in the GUI.
-It helps to make a good formatted results. Usually helpful for custom reporting.
See a sample screen shot.

8. jp@gc - Hits per Second
-This is like as other listeners showing Hits/s.
-This shows hits to the server.(send requests by client)

9. jp@gc - Loadosophia.org Uploader
This needs spatial plugin library to be installed. Download link is here. Keep the files in \apache-jmeter-2.9\lib directory.
This is a spatial listener to upload results to Loadosophia.org after test complete. It may keep test plan also. When we add, this , we will need to fill out the following.
Upload Project : Name of the project to upload. It is private token, need from Loadosophia.org. Who knows the token, he can upload the project.
Directory to store data for upload : path to store
Test title : Title of the running test
Upload token: The token that we will send
Caution : It can upload your data/files to Loadosophia
To know more, see this . And to get the token, go here. They are providing service to analysis data . To use their service you have to upload results.
See a sample screen shot.

10. jp@gc - Page Data Extractor
-It shows the data that we extract from a page response(status, health, message)
-We can add multiple regular expression to extract data. When we add a row there are 4 parameters,
Chart Label : This is the label which will be shown in the chart representing the value.
Regular Expression value extractor : The regular repression  that we will use
Delta : [I do not know yet]
RegExp Label : It is a check box that enables adding label with results.
-In graph, every line show each finding from expression.
-It is actually data over time graph, the more data we get the high value will be in Y axis.

11.jp@gc - PerfMon Metrics Collector
-This is spatially used With Pref Mon server plug ins. I will make a separate post spatially for this.

12. jp@gc - Response Codes per Second
-This is number of response code( HTTP , response code like http 200) over time.
- Each line in graph represents individual HTTP code

13. jp@gc - Response Latencies Over Time
-This is a spatial type of listener that shows latency. Latency means the time between the end of the request and the beginning of the server response. In a short way , the communication time is latency time. Neither application or server is responsible for that, only environments are responsible for that.
-It is response latency (millisecond) vs progress time(s) graph

14. jp@gc - Response Times Distribution
-This shows number of response over response time(millisecond over X axis)
-It shows every Thread/sample individually in Bar diagram
-It can show show all threads/samples together(average)

15. jp@gc - Response Times Over Time
-This shows response time on how much test progresses(time)(X axis)
-Time shown in millisecond (Y axis)
-hr:min:sec format time shown on for test progress.
-It shows every sampler individually
-It can show show all sampler together(average)

16. jp@gc - Response Times Percentiles
-This shows response time on how many percentage(%) completed(X axis)
-Time shown in millisecond.
-It shows every sampler individually
-It can show show all sampler together(average)
-Percentage calculated 0.1 to 99.9 % range.

17. jp@gc - Response Times vs Threads
-This shows response time on user (thread) increment.
-Time shown in millisecond.
-It shows every sampler individually
-It show shows all sampler together(average)

18. jp@gc - Transaction Throughput vs Threads
-This is same as Response Times vs Threads, but shows Estimated Transaction/s.
-It shows the statistical maximum possible number of transactions based on number of users (threads)accessing the application
-Formula is Thread count * /Server Response time in second. (or Thread*1000/time in millisecond)

19. jp@gc - Transactions per Second
-This is like as other listeners showing Transaction/s.
-This shows transactions from each samplers in one second time period.
-It shows every sampler individually
-It can show show all sampler together(average)
-In aggregated view, it shows fail transactions also.
-The graphs shown in manner of full execution time(full time plotted in X axis)

2013-05-09

Introduction to JMeter Google PlugIn- Pre Processors

In this article we are going to see what are additional features/items added after installing jmeter plugin (Google Plugin) and what we can do with it. I will discuses about Pre Processors only. To know about basic of jmeter see my this page. And, the process to install plug in , see this post.

What is pre processor? Typically, a pre processor will process data or provide information before the sampler request send. That means, all parameter data can be handled by Pre processors. After adding Google plugin, we get two type of pre processors.

1. jp@gc - Inter-Thread Communication PreProcessor
-Right click a Test Plan or thread > Pre Processors> jp@gc - Inter-Thread Communication PreProcessor
 
-This is same as it's brother jp@gc - Inter-Thread Communication PostProcessor. Actually, both of them are used together. It is used for getting the value from the queue and use the value to processors any sampler before sending a request. It supports all functions and settings like as jp@gc - Inter-Thread Communication PostProcessor. To get detail idea about it's supporting see my previous post.
-We can set timeouts here to make it more time driven when working with data.
-One of the best way to keep the data and use them before sending request.

2. jp@gc - Raw Data Source PreProcessor
-Right click a Test Plan or thread > Pre Processors> jp@gc - Raw Data Source PreProcessor
-This is another way of reading file rather than CSV data set config.
-This is one of the best way to read for Binary data.
-This is very helpful when we work with TCP or RAW data.
-This HTTP Raw requests/ UDP request in easy way that helps to work with large data set.
-As it is using Raw file, the raw file format should be like this . We can also see this from response data of a http request from View Result Tree Listener.
-In the raw file, there is chunk marker(number) which defines the pursing of raw data.
Note : I have not use this one, as long as I have used it, I will add more comments.

Thanks...:)