Re: Combining Counter and While Controller
On 20 March 2012 04:19, Pulkit Singhal pulkitsing...@gmail.com wrote: Changing the condition from: ${__javaScript(${upcCounter}=${__P(upcTotal)})} to something like: ${__javaScript(${upcCounter}=10)} helps narrow down the problem to the following chunk of code: ${__P(upcTotal)} So are JMeter Properties not evaluate-able in logic controllers? It's a function call (that happens to read a property), such calls are valid wherever a variable reference is valid. On Mon, Mar 19, 2012 at 12:10 PM, Pulkit Singhal pulkitsing...@gmail.comwrote: 1) The data that I need to access is present in JMeterProperties (comes from a different thread group - consecutive excution): upcArray_1 = 012934023423 ... upcArray_10 = 342034234233 Therefore the foreach controller does not work for me as it tries to find the prefix (upcArray) in the JMeterVariables which is not the right place to look for it. 2) So I am attempting to add a counter as the child of the while controller to let me loop through the data in the JMeterProperties: WHILE CONTROLLER Condition: ${__javaScript(${upcCounter}=${__P(upcTotal)})} CHILD COUNTER Start: 1 Increment: 1 Reference Name: upcCounter Track Counter Independently for each user - YES 3) But it counts 1 then 2 and then its stops! It doesn't go all the way up to 10 ... what am I doing wrong here? - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
Re: GUI problem with new Post Body feature of Http Sampler
Thanks for the reply, I'll try using the version from trunk for a while, though I usually worked with major releases only. Much appreciated, Adrian On Mon, Mar 19, 2012 at 9:49 PM, Philippe Mouawad philippe.moua...@gmail.com wrote: Hello, Hello I tested your case and I can reproduce it in JMEter 2.6 but not with Trunk, cause I think it has been fixed with : - https://issues.apache.org/bugzilla/show_bug.cgi?id=52613 This issue is fixed in trunk. Regards Philippe On Mon, Mar 19, 2012 at 5:15 PM, Adrian Speteanu asp.ad...@gmail.com wrote: Hi guys, Got a weird one for you today. When entering non-ASCII characters in the Post Body section of the Http Sampler, the structure of the test plan is corrupted. The GUI fails to update and I've found out the hard way: when quick saving (I've looked in the saved jmx, I think, the structure is not proper). Used the following test char-group to reproduce this one: !#$%_?§ÄäÖöÜüßÁÀÂÃÇÉÈÊÍÌÎÏÑÓÒÔÕÚÙÛÝáàâãçéèêíìîïñóòôõúùûýÅÆÐËØßþåæðëøµÞ£ƒ®©¥¿ -- My plan looks like: + thread group ++ http request [gui configs: Method = POST / Content encoding = utf-8 / use Post Body to add raw post data of multi-part type] +++ Pre-processors / Counters / Http Header Manager (defines custom multi-part content type boundary) / Assertions / Timer / Regex / Xpath checker * the last hierarchic level doesn't affect reproduction of issue This is needed because some basics tweaks of the post data must be made before making the requests. After saving the plan, the jmx seems to be messed up, I think the nodes are broken or not properly formatted. Other details: ubuntu, Two problems: 1. The raw field should work with any characters from the encoding specified. Shouldn't it? - I thought of a quick fix here, to paste the URI-encoded version of the string 2. This issue messed up some changes that are rather important. Do you have any suggestion on what tools to use to repair an XML? :) I've tried removing the content of the Raw Post Body or the entire sampler that caused the problem, but the first doesn't solve the problem and the second only messes the test plan more. Regards, Adrian -- Cordialement. Philippe Mouawad.
Query Regarding the Ramp Up Period in Forever Mode and Loop Mode
Hello JMeter'ians, While working with JMeter, I am just confused with the Ramp-up period field in two different situations. Ex. 1. No. # Thread (Users): 5 Ramp Up Period: 300 sec *Loop Count #: 1* My Understanding: 5 Users will hit to the server in 300 secs (1 min for 1 user). Ex. 2. No. # Thread (Users): 5 Ramp Up Period: 300 sec *Loop Count #: Forever (when i schedule it for a particular period say for 30 min.)* My Understanding:* I am not clear on this front **... What is the use or affect of Ramp-up period here in this scenario (scheduled mechanism)?* Is there no purpose of this Ramp-Up period in Forever mode??? (I hope I am *wrong *here in this consideration) Thanks, Shirish
Re: Query Regarding the Ramp Up Period in Forever Mode and Loop Mode
On 20 March 2012 13:45, Shirish shirish.ganje...@gmail.com wrote: Hello JMeter'ians, While working with JMeter, I am just confused with the Ramp-up period field in two different situations. Please read: http://jmeter.apache.org/usermanual/component_reference.html#Thread_Group Ex. 1. No. # Thread (Users): 5 Ramp Up Period: 300 sec *Loop Count #: 1* My Understanding: 5 Users will hit to the server in 300 secs (1 min for 1 user). Ex. 2. No. # Thread (Users): 5 Ramp Up Period: 300 sec *Loop Count #: Forever (when i schedule it for a particular period say for 30 min.)* My Understanding:* I am not clear on this front **... What is the use or affect of Ramp-up period here in this scenario (scheduled mechanism)?* Is there no purpose of this Ramp-Up period in Forever mode??? (I hope I am *wrong *here in this consideration) Thanks, Shirish - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
Display total execution time for test plan
Hi all, I've created a test plan to put some load on a flow of pages we have. I'm quite new to JMeter, and I have a small question on how to get the information I'm looking for. I've got a working test plan, I can see the samples, the throughput, etc, but I can't find anywhere what the time was to execute this testplan, or a single loop of this testplan when I execute it multiple times. Can someone give me a small heads up how I can record and view this time? Kind regards, Erik Pragt - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
Re: Display total execution time for test plan
Hi Adrian, Thanks for the super quick reply. I'm a bit surprised by your first remark though, so maybe I'm having a wrong approach here. I'm currently developing an application which might have some performance issues. Our current target is around 1000 simultaneous logged in users, and around 10 concurrent 'clicks'. My current approach was to sort of simulate that behavior in JMeter, check how long it takes for the simulated users to finish their flows, make some adjustments, test again, and check if my simulated users are faster than before. Based on this, I need the total execution time, but apparently this is not the usual approach, else it would certainly have been in there somewhere. Could you recommend what would be a better way to test my scenario? I'm not a performance rock star at all, so I'm very curious what would be an effective way in improving the application and using JMeter as the load generator in that. Kind regards, Erik Pragt On Tue, Mar 20, 2012 at 5:44 PM, Adrian Speteanu asp.ad...@gmail.com wrote: Hi Erik, A very interesting idea. You can find start / stop time in jmeter's log. When running from a console in non-gui mode, you also get some more statistics then in GUI (how long the test ran). You can also schedule a test to run for a certain amount of time, or starting / stopping at certain hours (so you don't have to worry about this stuff). If you are interested in response times, however, the sum of all requests, then things get more complicated. Adrian On Tue, Mar 20, 2012 at 6:21 PM, Erik Pragt erik.pr...@jworks.nl wrote: Hi all, I've created a test plan to put some load on a flow of pages we have. I'm quite new to JMeter, and I have a small question on how to get the information I'm looking for. I've got a working test plan, I can see the samples, the throughput, etc, but I can't find anywhere what the time was to execute this testplan, or a single loop of this testplan when I execute it multiple times. Can someone give me a small heads up how I can record and view this time? Kind regards, Erik Pragt - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
Re: unable to share variables
On 20 March 2012 19:00, jake_dev...@playstation.sony.com wrote: So I've tried using the vars.putObject/vars.getObject, the vars always seem to be reset, even when the param to reset is false. I've tried throwing variables in BeanShellSampler.bshrc in the bsh.shared namespace, which had good results, except it only works on ints. This suggests that you are trying to share variables across threads - is that the case? Basically I want to be able to open a file and read a single line per loop iteration in each thread and be able to do the same with writing to a file. CSV Dataset or the StringFromFile function might be suitable for reading the file. To write to a single file, a Listener would be appropriate. Thanks, Jake Devore - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
RE: Display total execution time for test plan
I have a similar need, so I cobbled together a special threadgroup to time my actual 'test' threadgroups, and it can be used to time the entire test plan as well... I'm not sure it would work well for the individual thread execution times, but those are really going to be measured by the number of iterations divided into the total thread group time anyway. NOTE: this system really only works if your threadgroups are run consecutively in the test plan - since the timers have to run after each threadgroup runs... But it is a start. BTW, I totally agree with you - this is something that should be included in the standard tools (e.g. fields in the summary report): test execution elapsed time, and threadgroup execution elapsed time... The 'test execution elapsed time' needs to be a meta field in the summary report - since it applies to the entire test. The 'threadgroup execution elapsed time' needs to be an optional row added to the summary report output that identifies the threadgroup name and elapsed time. Basically I add a threadgroup at the top of my test plan that gets the current time in milliseconds since epoch. Then after each threadgroup that is actually 'sampling' my system, I add another threadgroup that updates the time elapsed with the current info. If you save the below as a .jmx file, you can see what I'm talking about. Just add your threadgroup between the two that are defined already, and run a test - it will show you a timer row _before_ the first thread group, and another _after_ the first thread group: ?xml version=1.0 encoding=UTF-8? jmeterTestPlan version=1.2 properties=2.2 hashTree TestPlan guiclass=TestPlanGui testclass=TestPlan testname=TG Timer Config enabled=true stringProp name=TestPlan.comments/stringProp boolProp name=TestPlan.functional_modefalse/boolProp boolProp name=TestPlan.serialize_threadgroupstrue/boolProp elementProp name=TestPlan.user_defined_variables elementType=Arguments guiclass=ArgumentsPanel testclass=Arguments testname=User Defined Variables enabled=true collectionProp name=Arguments.arguments/ /elementProp stringProp name=TestPlan.user_define_classpath/stringProp collectionProp name=TestPlan.thread_groups/ /TestPlan hashTree ThreadGroup guiclass=ThreadGroupGui testclass=ThreadGroup testname=Start TG Timer enabled=true stringProp name=ThreadGroup.on_sample_errorcontinue/stringProp elementProp name=ThreadGroup.main_controller elementType=LoopController guiclass=LoopControlPanel testclass=LoopController testname=Loop Controller enabled=true boolProp name=LoopController.continue_foreverfalse/boolProp stringProp name=LoopController.loops1/stringProp /elementProp stringProp name=ThreadGroup.num_threads1/stringProp stringProp name=ThreadGroup.ramp_time0/stringProp longProp name=ThreadGroup.start_time1320342967000/longProp longProp name=ThreadGroup.end_time1320342967000/longProp boolProp name=ThreadGroup.schedulerfalse/boolProp stringProp name=ThreadGroup.duration/stringProp stringProp name=ThreadGroup.delay/stringProp /ThreadGroup hashTree UserParameters guiclass=UserParametersGui testclass=UserParameters testname=User Parameters enabled=true collectionProp name=UserParameters.names stringProp name=1185546556PrevStartTime/stringProp stringProp name=-1987142487PrevTGCount/stringProp stringProp name=0/stringProp stringProp name=1182835273ElapsedTime/stringProp stringProp name=-1999321243threadStartTime/stringProp stringProp name=-1409654180tgCount/stringProp stringProp name=1984987727setTime/stringProp stringProp name=647878586setTGCount/stringProp /collectionProp collectionProp name=UserParameters.thread_values collectionProp name=-1834623057 stringProp name=-2078679218${__P(ThreadStartTime,0)}/stringProp stringProp name=46204838${__P(TGCount,1)}/stringProp stringProp name=0/stringProp stringProp name=480/stringProp stringProp name=1008029728${__javaScript(var ms = new Date; ms.getTime();)}/stringProp stringProp name=491/stringProp stringProp name=1759500564${__setProperty(ThreadStartTime, ${threadStartTime})}/stringProp stringProp name=-1525630572${__setProperty(TGCount, ${tgCount})}/stringProp /collectionProp /collectionProp boolProp name=UserParameters.per_iterationfalse/boolProp /UserParameters hashTree/ DebugSampler guiclass=TestBeanGUI testclass=DebugSampler testname=TG ${tgCount} Start: ${threadStartTime} - Elapsed: ${ElapsedTime} enabled=true boolProp name=displayJMeterPropertiesfalse/boolProp boolProp
Re: unable to share variables
This suggests that you are trying to share variables across threads - is that the case? For testing I only have one thread to cut down time, but I was trying to use multiple threads before. CSV Dataset or the StringFromFile function might be suitable for reading the file. To write to a single file, a Listener would be appropriate. I added this to my BeanShellSampler.bshrc: bsh.shared.lock = new ReentrantReadWriteLock(); bsh.shared.vpaths = new Vector(1000, 1000); bsh.shared.index = 0; I tried declaring the var types before the bsh.shared... with the same issues. I have a beanshell preprocessor outside the threads group with this code: import java.util.*; import java.io.*; int wm = Integer.parseInt(vars.get(write_mode)); if(wm == 0) { BufferedReader file = new BufferedReader(new FileReader(paths)); String s; while((s = file.readLine()) != null) { bsh.shared.vpaths.addElement(new String(s)); } file.close(); } In the thread group I have a loop with this beanshell preprocessor on it: import java.util.*; import java.util.concurrent.locks.ReentrantReadWriteLock; bsh.shared.lock.readLock().lock(); vars.put(path, bsh.shared.vpaths.elementAt(bsh.shared.index)); ++bsh.shared.index bsh.shared.lock.readLock().unlock(); The above is on the read type of test. I've tried forward declarations but it seems like beanshell can't tell what type of variables they are, it works fine on integers. I've also tried using putObject and getObject, but it seems that the vars are reset each time the shell is invoked, even if the reset is set to false. I was using the BufferedReader before directly in each read or write preprocessor, but it only got the first line of the file so I figured a string list might work, but it just has different issues. Thanks, Jake Devore SCE WWS OTG Operations Engineering (253) 981-4252 sebb seb...@gmail.com 03/20/2012 12:44 PM Please respond to JMeter Users List user@jmeter.apache.org To JMeter Users List user@jmeter.apache.org cc Subject Re: unable to share variables On 20 March 2012 19:00, jake_dev...@playstation.sony.com wrote: So I've tried using the vars.putObject/vars.getObject, the vars always seem to be reset, even when the param to reset is false. I've tried throwing variables in BeanShellSampler.bshrc in the bsh.shared namespace, which had good results, except it only works on ints. This suggests that you are trying to share variables across threads - is that the case? Basically I want to be able to open a file and read a single line per loop iteration in each thread and be able to do the same with writing to a file. CSV Dataset or the StringFromFile function might be suitable for reading the file. To write to a single file, a Listener would be appropriate. Thanks, Jake Devore - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
Re: Display total execution time for test plan
Hi Adrian and Eric, maybe I'm missing some point, but to me the total duration of the test is rarely important nor predictable. If you need it as a baseline, you can use an aggregate result listener, run some test (maybe with one or two users) and then you can multiply the number of samples (eventually divided the number of loops executed) by the average execution time. So you can easily have the net time you need to do a single loop. This is net of time spent on timers. But when you start having 1000 users, you have a lot of parallelizaton, but obviously not the 100% (that would be ideal). Also in some case, you have to add the ramp-up time. In my experience, we usually end up measuring the behaviour of few key transactions (e.g. submit the order, or login/logout), under different situations and loads, The relationship between average, mean, 90nth % and max return an idea of the way things go. Note that these transactions are also the longest. A static page or an image takes few msec to download, and most of the time spent is due to the network latency, which is not something we can easily optimize. This is my point of view, feel free to share your thoughts. best regards Sergio Il 20/03/2012 17:55, Erik Pragt ha scritto: Hi Adrian, Thanks for the super quick reply. I'm a bit surprised by your first remark though, so maybe I'm having a wrong approach here. I'm currently developing an application which might have some performance issues. Our current target is around 1000 simultaneous logged in users, and around 10 concurrent 'clicks'. My current approach was to sort of simulate that behavior in JMeter, check how long it takes for the simulated users to finish their flows, make some adjustments, test again, and check if my simulated users are faster than before. Based on this, I need the total execution time, but apparently this is not the usual approach, else it would certainly have been in there somewhere. Could you recommend what would be a better way to test my scenario? I'm not a performance rock star at all, so I'm very curious what would be an effective way in improving the application and using JMeter as the load generator in that. Kind regards, Erik Pragt On Tue, Mar 20, 2012 at 5:44 PM, Adrian Speteanuasp.ad...@gmail.com wrote: Hi Erik, A very interesting idea. You can find start / stop time in jmeter's log. When running from a console in non-gui mode, you also get some more statistics then in GUI (how long the test ran). You can also schedule a test to run for a certain amount of time, or starting / stopping at certain hours (so you don't have to worry about this stuff). If you are interested in response times, however, the sum of all requests, then things get more complicated. Adrian On Tue, Mar 20, 2012 at 6:21 PM, Erik Pragterik.pr...@jworks.nl wrote: Hi all, I've created a test plan to put some load on a flow of pages we have. I'm quite new to JMeter, and I have a small question on how to get the information I'm looking for. I've got a working test plan, I can see the samples, the throughput, etc, but I can't find anywhere what the time was to execute this testplan, or a single loop of this testplan when I execute it multiple times. Can someone give me a small heads up how I can record and view this time? Kind regards, Erik Pragt - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org -- Ing. Sergio Boso In caso di erronea ricezione da parte di persona diversa, siete pregati di eliminare il messaggio e i suoi allegati in modo definitivo dai vostri archivi e di volercelo comunicare immediatamente restituendoci il messaggio via e-mail al seguente indirizzoser...@bosoconsulting.it mailto:sergiob...@yahoo.it L’interessato può, inoltre, esercitare tutti i diritti di accesso sui propri dati previsti dal decreto 196/2003, tra i quali i diritti di rettifica, aggiornamento e cancellazione, inviando un messaggio all’indirizzo:ser...@bosoconsulting.it mailto:sergiob...@yahoo.it - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
Re: unable to share variables
Can I write out to that csv file? Basically I need to write out the paths that are generated to a file so I can read them in later. Thanks, Jake Devore SCE WWS OTG Operations Engineering (253) 981-4252 sebb seb...@gmail.com 03/20/2012 05:56 PM Please respond to JMeter Users List user@jmeter.apache.org To JMeter Users List user@jmeter.apache.org cc Subject Re: unable to share variables On 20 March 2012 20:08, jake_dev...@playstation.sony.com wrote: This suggests that you are trying to share variables across threads - is that the case? For testing I only have one thread to cut down time, but I was trying to use multiple threads before. CSV Dataset or the StringFromFile function might be suitable for reading the file. To write to a single file, a Listener would be appropriate. I added this to my BeanShellSampler.bshrc: bsh.shared.lock = new ReentrantReadWriteLock(); bsh.shared.vpaths = new Vector(1000, 1000); bsh.shared.index = 0; I tried declaring the var types before the bsh.shared... with the same issues. I have a beanshell preprocessor outside the threads group with this code: import java.util.*; import java.io.*; int wm = Integer.parseInt(vars.get(write_mode)); if(wm == 0) { BufferedReader file = new BufferedReader(new FileReader(paths)); String s; while((s = file.readLine()) != null) { bsh.shared.vpaths.addElement(new String(s)); } file.close(); } In the thread group I have a loop with this beanshell preprocessor on it: import java.util.*; import java.util.concurrent.locks.ReentrantReadWriteLock; bsh.shared.lock.readLock().lock(); vars.put(path, bsh.shared.vpaths.elementAt(bsh.shared.index)); ++bsh.shared.index bsh.shared.lock.readLock().unlock(); The above is on the read type of test. I've tried forward declarations but it seems like beanshell can't tell what type of variables they are, it works fine on integers. I've also tried using putObject and getObject, but it seems that the vars are reset each time the shell is invoked, even if the reset is set to false. I was using the BufferedReader before directly in each read or write preprocessor, but it only got the first line of the file so I figured a string list might work, but it just has different issues. CSVDataset and StringFromFile are designed for use with JMeter threads. Given what you have said are the requirements, these are suitable. If they don't seem to work, then describe what you have tried, what happened, and what you expected to happen. Thanks, Jake Devore SCE WWS OTG Operations Engineering (253) 981-4252 sebb seb...@gmail.com 03/20/2012 12:44 PM Please respond to JMeter Users List user@jmeter.apache.org To JMeter Users List user@jmeter.apache.org cc Subject Re: unable to share variables On 20 March 2012 19:00, jake_dev...@playstation.sony.com wrote: So I've tried using the vars.putObject/vars.getObject, the vars always seem to be reset, even when the param to reset is false. I've tried throwing variables in BeanShellSampler.bshrc in the bsh.shared namespace, which had good results, except it only works on ints. This suggests that you are trying to share variables across threads - is that the case? Basically I want to be able to open a file and read a single line per loop iteration in each thread and be able to do the same with writing to a file. CSV Dataset or the StringFromFile function might be suitable for reading the file. To write to a single file, a Listener would be appropriate. Thanks, Jake Devore - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org