Solved

JMeter Configuration

Posted on 2004-04-27
5
1,383 Views
Last Modified: 2011-09-20
This is  regarding passing data to JMeter.
I have generated two data files (for parameters that are to be used by JMeter for driving the load test) and want JMeter to read the data from these files before starting any of my test cases.

Is there some way to configure these files for JMeter(I mean can we place these files at some location for Jmeter access(or can we specify the paths of these files in configuration parameters?

(These parameters being intialization parameters , I dont want to pass these parameters from the exernal java request, that is the class that implements the JavaSamplerClient interface)
 
Thanks and Regards
Priya
0
Comment
Question by:priya_soparkar
  • 2
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
someman4oneman earned 500 total points
Comment Utility
Hi priya_soparkar
In JMeter
Go to Options --> Function Helper Dialog

In the drop downmenu choose _StringFromFile
This will load you params from a file.

See
http://jakarta.apache.org/jmeter/usermanual/functions.html

0
 

Author Comment

by:priya_soparkar
Comment Utility
Hi !
Thanks for the response.
One doubt , as the Apache documentation specifies , the _StringFromFile
function reads one complete line for each request .

In my case i have 3 attributes that constitute one record in the file that is to be read  and I want to read these 3 attributes as 3 parameters.

e.g .in my file i have one record of
Val1  Val2 Val3
and I want to read these 3 values in 3 parameters as one record .
Can we do this using _StringFromFile ?

I came across the "user-defined function" option in the same category but unfortunately documentation doesnt specify how to specify parameters in this user defined function and get them in user parameters.


Thanks and Regards
Priya
0
 
LVL 1

Expert Comment

by:someman4oneman
Comment Utility
priya_soparkar
I did some more sniffing round and it would appear that the
users.xml in the bin folder is more like what you are looking for.

As well as the docs there is
http://www.newsforge.com/software/04/02/19/1452218.shtml

to show you what is happening.


0
 

Author Comment

by:priya_soparkar
Comment Utility
Hi !
In  my scenario, I have the data file for say 100000 records  which i want to use for JMeter to pass data for each thread.
Now my application spawns 100 threads for say 5 iterations and I the requirement is such that intial 100 thread will use first 100 records form the data file in first iteration.
In next iteration the same 100 threads should now records from 101 onwards .
So in each iteration the threads will use different data.

(I understand that when we execute the threads in the loop, chanding the
data for the thread does not sound logical).

So is that the right approach to
1) Add a user defined function class in JMeter's oprn source in
org.apache.jmeter.functions
2)Here, open the file ,read the values for 100 records.
3)Maintain file pointer(say with last record read)
4)For next set of records to be read use this pointer for "next" record
5)Close the file when total number of samples are spawned.
(That means in a file of 1000 records if 100 threads are spawned 5 times , 50 records will be read).

Please correct me if i am misinterpretting something.

And the other option that u have mentioned about users.xml file,
I still not able to map the relation of
<thread>
           <par1>
                 <par1-name></par1-name>
                 <par1-value></par1-value>
          </par1>
          <par2>
                 <par2-name></par1-name>
                 <par2-value></par2-value>
           </par2>
</thread>

JMeter documentation says that each <thread></thread> block corresponds to each user paramaters.

So cant this be used in the sceanio other than HTTP request ? Like here i want to use JavaRequest and get this data from some file ?

Please write comments on both scenarios if possible.
I am trying to find the best way to do this.

Thanks and Regards
Priya

0
 

Expert Comment

by:atmohsin
Comment Utility
Hi Priya
    I am also facing the same problme. Let me know which solution you have adapted.

Mohsin
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now