jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From unjc email <unjc.em...@gmail.com>
Subject Re: Bad Throughput with Preprocessor
Date Fri, 20 Jul 2012 15:08:48 GMT
Sebb, thanks for your suggestion.   I am using a Beanshell function
defined in the init script, and the performance is much better when
the samplers make the function call during the run.

Test Plan (Run thread groups consecutively)
> Counter
> CSV Data Set #1
> CSV Data Set #2
> Thread Group #1
>> Debug Sampler
>>> Beanshell PreProcessor (Some logic to calculate some values and put them in PROPS)
> Thread Group #2
>> HTTP Request (${__BeanShell(generatePath("${filename}"))} )

However, I noticeStandardJMeterEngine makes a "test" call of the
BeanShell function before starting the thread groups and loading CSV
data sources.  Because there is a property value prepared in the first
thread group for the HTTP sampler in the second thread group, the
"Integer.parseInt" would fail if the BeanShell function is called
before the property value is even defined in the first thread group.
Anyone has experienced that?    Is there a way to ensure csv data
sources and property values are ready before a thread group starts?


2012/07/20 14:30:57 INFO  - jmeter.engine.StandardJMeterEngine:
Listeners will be started after enabling running version
2012/07/20 14:30:57 INFO  - jmeter.engine.StandardJMeterEngine: To
revert to the earlier behaviour, define
jmeterengine.startlistenerslater=false
2012/07/20 14:30:57 INFO  - jmeter.engine.StandardJMeterEngine:
Running the test!
2012/07/20 14:30:57 INFO  - jmeter.functions.BeanShell:
             CNT = null | REQFILE = ${filename} | RVALUE = null
2012/07/20 14:30:57 ERROR - jmeter.util.BeanShellInterpreter: Error
invoking bsh method: eval   Sourced file: inline evaluation of:
``generatePath("${filename}");'' : Typed variable declaration : Method
Invocation Integer.parseInt
2012/07/20 14:30:57 WARN  - jmeter.functions.BeanShell: Error running
BSH script org.apache.jorphan.util.JMeterException: Error invoking bsh
method: eval       Sourced file: inline evaluation of:
``generatePath("${filename}");'' : Typed variable declaration : Method
Invocation Integer.parseInt
        at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:192)
        at org.apache.jmeter.util.BeanShellInterpreter.eval(BeanShellInterpreter.java:198)
        at org.apache.jmeter.functions.BeanShell.execute(BeanShell.java:103)
        at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:141)
        at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:116)
        at org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(FunctionProperty.java:90)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.testStarted(HTTPSamplerBase.java:1322)
        at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:224)
        at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:349)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:171)
        ... 9 more
Caused by: Sourced file: inline evaluation of:
``generatePath("${filename}");'' : Typed variable declaration : Method
Invocation Integer.parseInt : at Line: 91 : in file:
BeanShellFunction.bshrc : Integer .parseInt ( props .get ( "rvalue" )
)

Called from method: generatePath : at Line: 1 : in file: inline
evaluation of: ``generatePath("${filename}");'' : generatePath (
"${filename}" )
Target exception: java.lang.NumberFormatException: null

        at bsh.BSHMethodInvocation.eval(Unknown Source)
        at bsh.BSHPrimaryExpression.eval(Unknown Source)
        at bsh.BSHPrimaryExpression.eval(Unknown Source)
        at bsh.BSHVariableDeclarator.eval(Unknown Source)
        at bsh.BSHTypedVariableDeclaration.eval(Unknown Source)
        at bsh.BSHBlock.evalBlock(Unknown Source)
        at bsh.BSHBlock.eval(Unknown Source)
        at bsh.BshMethod.invokeImpl(Unknown Source)
        at bsh.BshMethod.invoke(Unknown Source)
        at bsh.BshMethod.invoke(Unknown Source)
        at bsh.Name.invokeLocalMethod(Unknown Source)
        at bsh.Name.invokeMethod(Unknown Source)
        at bsh.BSHMethodInvocation.eval(Unknown Source)
        at bsh.BSHPrimaryExpression.eval(Unknown Source)
        at bsh.BSHPrimaryExpression.eval(Unknown Source)
        at bsh.Interpreter.eval(Unknown Source)
        at bsh.Interpreter.eval(Unknown Source)
        at bsh.Interpreter.eval(Unknown Source)
        ... 14 more

2012/07/20 14:30:57 INFO  - jmeter.gui.util.JMeterMenuBar:
setRunning(true,*local*)
2012/07/20 14:30:58 INFO  - jmeter.engine.StandardJMeterEngine:
Starting 1 threads for group Thread Group.
2012/07/20 14:30:58 INFO  - jmeter.engine.StandardJMeterEngine: Test
will stop abruptly on error
2012/07/20 14:30:58 INFO  - jmeter.threads.JMeterThread:
jmeterthread.startearlier=true (see jmeter.properties)
2012/07/20 14:30:58 INFO  - jmeter.threads.JMeterThread: Running
PostProcessors in forward order
2012/07/20 14:30:58 INFO  - jmeter.engine.StandardJMeterEngine:
Waiting for thread group: Thread Group to finish before starting next
group
2012/07/20 14:30:58 INFO  - jmeter.threads.JMeterThread: Thread
started: Thread Group 1-1
2012/07/20 14:30:58 INFO  - jmeter.services.FileServer: Stored: reqs.csv
2012/07/20 14:30:58 INFO  - jmeter.threads.JMeterThread: Thread
finished: Thread Group 1-1
2012/07/20 14:30:58 INFO  - jmeter.engine.StandardJMeterEngine: Ending
thread Thread Group 1-1
2012/07/20 14:30:59 INFO  - jmeter.engine.StandardJMeterEngine:
Starting 5 threads for group Thread Group.
2012/07/20 14:30:59 INFO  - jmeter.engine.StandardJMeterEngine: Thread
will continue on error
2012/07/20 14:30:59 INFO  - jmeter.threads.JMeterThread: Thread
started: Thread Group 2-1
2012/07/20 14:30:59 INFO  - jmeter.functions.BeanShell:
             CNT = 1 | REQFILE = ${filename} | RVALUE = 2
2012/07/20 14:30:59 INFO  - jmeter.threads.JMeterThread: Thread
started: Thread Group 2-2
2012/07/20 14:30:59 INFO  - jmeter.threads.JMeterThread: Thread
started: Thread Group 2-3
2012/07/20 14:30:59 INFO  - jmeter.threads.JMeterThread: Thread
started: Thread Group 2-4



2012/07/20 14:30:57 INFO  - jmeter.engine.StandardJMeterEngine:
Listeners will be started after enabling running version
2012/07/20 14:30:57 INFO  - jmeter.engine.StandardJMeterEngine: To
revert to the earlier behaviour, define
jmeterengine.startlistenerslater=false
2012/07/20 14:30:57 INFO  - jmeter.engine.StandardJMeterEngine:
Running the test!
2012/07/20 14:30:57 INFO  - jmeter.functions.BeanShell:
             CNT = 1 | REQFILE = ${filename} | RVALUE = null
2012/07/20 14:30:57 ERROR - jmeter.util.BeanShellInterpreter: Error
invoking bsh method: eval   Sourced file: inline evaluation of:
``generatePath("${filename}");'' : Typed variable declaration : Method
Invocation Integer.parseInt
2012/07/20 14:30:57 WARN  - jmeter.functions.BeanShell: Error running
BSH script org.apache.jorphan.util.JMeterException: Error invoking bsh
method: eval       Sourced file: inline evaluation of:
``generatePath("${filename}");'' : Typed variable declaration : Method
Invocation Integer.parseInt
        at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:192)
        at org.apache.jmeter.util.BeanShellInterpreter.eval(BeanShellInterpreter.java:198)
        at org.apache.jmeter.functions.BeanShell.execute(BeanShell.java:103)
        at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:141)
        at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:116)
        at org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(FunctionProperty.java:90)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.testStarted(HTTPSamplerBase.java:1322)
        at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:224)
        at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:349)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:171)
        ... 9 more
Caused by: Sourced file: inline evaluation of:
``generatePath("${filename}");'' : Typed variable declaration : Method
Invocation Integer.parseInt : at Line: 91 : in file:
BeanShellFunction.bshrc : Integer .parseInt ( props .get ( "rvalue" )
)

Called from method: generatePath : at Line: 1 : in file: inline
evaluation of: ``generatePath("${filename}");'' : generatePath (
"${filename}" )
Target exception: java.lang.NumberFormatException: null

        at bsh.BSHMethodInvocation.eval(Unknown Source)
        at bsh.BSHPrimaryExpression.eval(Unknown Source)
        at bsh.BSHPrimaryExpression.eval(Unknown Source)
        at bsh.BSHVariableDeclarator.eval(Unknown Source)
        at bsh.BSHTypedVariableDeclaration.eval(Unknown Source)
        at bsh.BSHBlock.evalBlock(Unknown Source)
        at bsh.BSHBlock.eval(Unknown Source)
        at bsh.BshMethod.invokeImpl(Unknown Source)
        at bsh.BshMethod.invoke(Unknown Source)
        at bsh.BshMethod.invoke(Unknown Source)
        at bsh.Name.invokeLocalMethod(Unknown Source)
        at bsh.Name.invokeMethod(Unknown Source)
        at bsh.BSHMethodInvocation.eval(Unknown Source)
        at bsh.BSHPrimaryExpression.eval(Unknown Source)
        at bsh.BSHPrimaryExpression.eval(Unknown Source)
        at bsh.Interpreter.eval(Unknown Source)
        at bsh.Interpreter.eval(Unknown Source)
        at bsh.Interpreter.eval(Unknown Source)
        ... 14 more

2012/07/20 14:30:57 INFO  - jmeter.gui.util.JMeterMenuBar:
setRunning(true,*local*)
2012/07/20 14:30:58 INFO  - jmeter.engine.StandardJMeterEngine:
Starting 1 threads for group Thread Group.
2012/07/20 14:30:58 INFO  - jmeter.engine.StandardJMeterEngine: Test
will stop abruptly on error
2012/07/20 14:30:58 INFO  - jmeter.threads.JMeterThread:
jmeterthread.startearlier=true (see jmeter.properties)
2012/07/20 14:30:58 INFO  - jmeter.threads.JMeterThread: Running
PostProcessors in forward order
2012/07/20 14:30:58 INFO  - jmeter.engine.StandardJMeterEngine:
Waiting for thread group: Thread Group to finish before starting next
group
2012/07/20 14:30:58 INFO  - jmeter.threads.JMeterThread: Thread
started: Thread Group 1-1
2012/07/20 14:30:58 INFO  - jmeter.services.FileServer: Stored: reqs.csv
2012/07/20 14:30:58 INFO  - jmeter.threads.JMeterThread: Thread
finished: Thread Group 1-1
2012/07/20 14:30:58 INFO  - jmeter.engine.StandardJMeterEngine: Ending
thread Thread Group 1-1
2012/07/20 14:30:59 INFO  - jmeter.engine.StandardJMeterEngine:
Starting 5 threads for group Thread Group.
2012/07/20 14:30:59 INFO  - jmeter.engine.StandardJMeterEngine: Thread
will continue on error
2012/07/20 14:30:59 INFO  - jmeter.threads.JMeterThread: Thread
started: Thread Group 2-1
2012/07/20 14:30:59 INFO  - jmeter.functions.BeanShell:
             CNT = 1 | REQFILE = ${filename} | RVALUE = 2
2012/07/20 14:30:59 INFO  - jmeter.threads.JMeterThread: Thread
started: Thread Group 2-2
2012/07/20 14:30:59 INFO  - jmeter.threads.JMeterThread: Thread
started: Thread Group 2-3
2012/07/20 14:30:59 INFO  - jmeter.threads.JMeterThread: Thread
started: Thread Group 2-4
...



Thanks,
Jacky

On Wed, Jul 18, 2012 at 4:21 PM, sebb <sebbaz@gmail.com> wrote:
> On 18 July 2012 19:17, Anthony Johnson <ansoni@gmail.com> wrote:
>> Hey Jacky,
>>     If you are using the Beanshell Pre-processor and doing the 200
>> threads that you noted in another thread... you may be hitting a CPU
>> bottleneck on your machine.
>>
>> Some options that might help:
>>
>> Set Reset Interpretor to False (so that the beanshell instance can be re-used.
>> Use less threads
>> Use a faster machine or execute your test on more than 1 machine via
>> Remote Testing.
>
> It may help to use the BeanShell init script to define suitable
> methods, as that only has to be parsed once.
>
>> Hope this helps,
>>
>> Anthony
>>
>> On Wed, Jul 18, 2012 at 2:07 PM, unjc email <unjc.email@gmail.com> wrote:
>>> I need to use a preprocessor that allows script.  I know
>>> user-parameter is okay but I can't put logic in it.
>>>
>>>
>>> On Wed, Jul 18, 2012 at 12:54 PM, Robin D. Wilson <rwilson2@gmail.com>
wrote:
>>>> Does it matter which preprocessor you use? I use the User Parameters preprocessor
(a lot), and I haven't noticed this.
>>>>
>>>> --
>>>> Robin D. Wilson
>>>> Sr. Director of Web Development
>>>> KingsIsle Entertainment, Inc.
>>>> VOICE: 512-777-1861
>>>> www.KingsIsle.com
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: unjc email [mailto:unjc.email@gmail.com]
>>>> Sent: Wednesday, July 18, 2012 11:09 AM
>>>> To: JMeter Users List
>>>> Subject: Bad Throughput with Preprocessor
>>>>
>>>> Hello all,
>>>>
>>>> I want to test with dynamic-generated Url.  I found there is a huge
>>>> drop in throughput when I use preprocessor (even an empty
>>>> preprocessor) for the HTTP sampler.  The difference is as much as ten
>>>> times in my test.  Do any of you have any suggestion what to use if I
>>>> have to implement some logics for the sampler?   Any advice will be
>>>> greatly appreciated.
>>>>
>>>>
>>>>
>>>> Thanks,
>>>> Jacky
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Mime
View raw message