I need to test a set of HTTP Tomcat servers using JMeter. I have a list of 'n' target servers and a list of 'n' JMeter remote test servers and a list of a single variable parameters that will be tested in the URL against each Tomcat server. However, each JMeter remote test server should test only a single target server with a set of threads cycling through all the parameters - so the test is 1 to 1 but I need to collate the results as the target servers form a CDN edge set with a common origin URL.
How could I ensure that each target server is tested by a single JMeter server using the same set of parameters? Using a CSV DATA SET CONFIG for the list of parameters is obvious but I can't see how I could use the same type of config element for the list of target servers.
The only way I can envision it is that I distribute a csv file containing a single unique target URL to each remote JMeter server. That way all the hundreds of threads on each JMeter server only know about one target but can use a single filename for the source URL. Does anyone know of a better way?
JMeter remove "slaves" basically execute the same test plan which is being specified on the "master" machine so default configuration is not something you can use.
There are 2 options:
You can modify user.properties file on each slave machine to contain the single unique endpoint (URL) like:
in user.properties file define a property which will specify the endpoint:
url=http://some.cdn.1
in the Test Plan use __P() function to read the value like:
${__P(url)}
So given different url property on each remote slave each slave will be hitting different endpoint. See Apache JMeter Properties Customization Guide for more information regarding JMeter properties and ways of working with them.
You can use __machipeIP() or __machineName() function in conjunction with the If Controller so switch execution branches basing on the "slave" IP address or hostname, something like:
If Controller, condition: ${__machineIP()} == "172.30.40.50"
do something specific for CDN1
If Controller, condition: ${__machineIP()} == "172.30.40.51"
do something specific for CDN2
etc.
Related
My Thread Group contains "Include Controller" with a reference to jmx and a "Simple Controller" with http requests.
From Command line(Non GUI mode), While I execute,
I need CSV results to contain results only from "Simple Controller"
OR
a way to identify response time based on Controller name in the generated CSV
Can you please help - I am passing below code in the command line
sh Jmeter.sh -n -t R3Functions.jmx -l Results/Calendar.csv -J ucount=10
From the generated csv, I am finding it very difficult to get the
response time of http requests only under "Simple Controller"
as it also includes results of http requests from "Include Controller".
I'm not aware of any existing approaches to filter results basing belonging to this or that parent controller so I would recommend just use different labels for the requests originating from main and included .jmx files so you will be able to distinguish them either manually or using Filter Results Tool plugin which can filter sample results basing on regular expression matches of samplers labels (names).
You can install Filter Results Tool using JMeter Plugins Manager
Is There is away make Fiware-cepheus Take more than one Configuration file as i wan't to sent Different Data type and i want to process it in real time but can't install different Cepheus Vm to each Data federation Is there is a way to make Cepheus take different Configuration Files
Fiware-Cepheus supports an (undocumented...) multi-tenant mode where multiple configurations can live together on the same instance (sharing available memory/CPU resources).
You can enable the multi-tenant profile from app.properties:
spring.profiles.active=multi-tenant
or at boot time with the --spring.profiles.active=multi-tenant command line argument.
Then for each request, you can add two HTTP headers Fiware-Service (default value: default) and Fiware-ServicePath (default value: /).
Fiware-Service header can only contain [A-Za-z0-9_] characters, Fiware-ServicePath header must start with a /.
Each tenant needs its own configuration setup (using the same headers) before it can start processing data.
For more information, please read related code.
I have created jmeter script for load testing and added CSV data element to read Username and Password of 300 Users.Also followed below steps;
Created CSV file using a notepad and stored it in a directory where created script stored.
Defined variables and file path in CSV data set element
Used variables as parameters of HTTP request
Increased number of Threads
But it doesn't worked as expected.How can i fix this?
Temporary reduce threads count to 1-2, add View Results Tree listener and inspect request and response details.
If don't see proper username/password combination in the request body - your script is misconfigured. Check out Using CSV DATA SET CONFIG guide for detailed setup instructions.
If you see valid username/password pair but login is not successful, follow below checklist:
Add HTTP Cookie Manager to your test plan
If point 1 doesn't help - check for dynamic request parameters. Probably you'll need to extract some value from the first response (when you execute GET request for the login page) with the Regular Expression Extractor, convert it into a JMeter Variable and add it as a parameter to the request which performs login.
When logging in a CSV format in JMeter, is it possible to log a cookie value?
It seems to be possible log all cookie data when using XML logs (the option "Save Sampler Data (XML)"), but is there something like that, or better more specific (just a single specific cookie), for .csv?
We would like to use this to log a session ID cookie for all requests, so that it's possible to follow the requests in other application logs.
There are 2 JMeter Properties which can help you to get what you want:
CookieManager.save.cookies - CookieManager behaviour - should Cookies be stored as variables, can be "true" or "false". If it is set to "true" any cookie which is in scope will be accessible as a JMeter Variable in form of "COOKIE_cookieName". So if you have i.e. SESSIONID cookie it may be referred as "COOKIE_SESSIONID"
sample_variables- Optional list of JMeter variable names whose values are to be saved in the result data files.If you need more than 1 - the list should be comma-separated.
So if you set these 2 properties in i.e. user.properties file (in the /bin folder of your JMeter Installation) as
CookieManager.save.cookies=true
sample_variables=COOKIE_SESSIONID
your .jtl response will look something like:
1417446424571,459,HTTP Request,200,OK,Thread Group 1-1,text,true,10503,1,1,190,your SESSIONID cookie value here
NB
JMEter restart is required to read properties from user.properties file
You can override properties by passing them via -J command line argument as
jmeter -JCookieManager.save.cookies=true -Jsample_variables=COOKIE_SESSIONID -n -t /path/to/your/test/plan -l /path/to/results/file.jtl
See Apache JMeter Properties Customization Guide for more information on different JMeter properties and ways of setting and overriding them
Here's my situation:
I want to do this:
I have a list of URLs in a MySQL database which I want to hit using a HTTP Request to see if the response is a HTTP Status code of 404 or not.
I have done this:
Added and configured a JDBC Config Element.
Added and configured a JDBC Request Sampler. Basically a select statement that returns a table with 8 columns. I have provided 8 comma-separated variables for the 'Variable names' field, so that the results of the JDBC request can be identified with these variable names.
Created a HTTP Request Sampler that uses one of those variables ${url} in the 'Server Name or IP' field.
Though the JDBC request works flawlessly and returns a table with a bunch of rows, the problem with this is that the HTTP Request Sampler never picks up the variable from the JDBC Request result.
The HTTP Request looks like this in the 'View Results Tree':
GET http://${url}/
I have tried these solutions:
Add 'Save Responses to a File' listener to the JDBC Request. This creates a file of type '.plain' and not a CSV. Had it been a CSV, I could have utilized that CSV file by creating a CSV Data Set Config. So this attempt failed.
I have tried forcing the file name in the above attempt to always use 'C:\JMETERTest\data.csv'. But it ends up creating a new file named 'C:\JMETERTest\data.csv1.plain'. This attempt failed too.
I tried to reference the URL column as ${url_1} in the HTTP Request's Server Name field. It worked. But the problem now is that in the results tree, all the requests are going for the the URL from only the first row of the result set. I see that this is because of the row number '_1' specified in the ${url_1} above. I can use this if someone can suggest a way to parameterize the '_1' into a variable that I can loop through (probably using a 'Counter' element). I created a Counter Config Element by the Reference Name 'loopCounter'. And used this in the Server Name field of the HTTP Request:
${url_("${loopCounter}")}
But now my HTTP Requests look lamer:
GET http://${url_("${loopCounter}")}/
This did not work too.
Solution 3 looks more doable to be only if I could resolve the parameterization of the row number.
I am open to JMeter Plugin suggestions too.
I will update anything else that I try as we go on.
P.S. Please let me know if my question is not clear in anyway.
Have you tried wrapping the HTTP sampler in a ForEach controller (parent) where the variable for the controller is the URL variable obtained from the JDBC sampler?
Also, the output variable in the ForEach will be the variable you now use in the HTTP sampler.
That way it will iterate through each variable from the beginning of the index to the end and run the sampler once each time.
In 'Save responses to a File' Listener, Select Checkboxes "Don't add Suffix and Prefix". Checking these two options will ensure, you get exact Log file name.