You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Christensen, Alan" <al...@hp.com> on 2006/12/06 19:58:58 UTC

Yet another extractor question

 My returned html pages include a number in them that corresponds to the
back end time that was associated with processing the transaction.  I'd
like to figure out how I can extract this number and then have the
listeners log this number along with the other data logged for each
transaction.  Is there an easy way to do this?  I know that I can
extract a value from one sampler and append the extracted value to the
name field of the subsequent sampler.  But this associates the backend
time with the wrong line in the report.  Any suggestions?

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


RE: Yet another extractor question

Posted by "Christensen, Alan" <al...@hp.com>.
My script is now working properly.  Reversing the order caused the
regular expression post processor to execute first. Thanks for your
help!  

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Saturday, December 09, 2006 5:54 AM
To: JMeter Users List
Subject: Re: Yet another extractor question

It was discovered a few months back that JMeter runs Post-Processors in
reverse order - no idea why - but I forgot to create a Bugzilla issue.

I have now:

http://issues.apache.org/bugzilla/show_bug.cgi?id=41140

The bug has yet to be corrected.

Try reversing the order of the Post-Processors - that should fix it.

S.

On 09/12/06, Christensen, Alan <al...@hp.com> wrote:
> That solved my problem with the null pointer.  Now the problem is that

> the beanshell script
>
>    prev.setResponseMessage("${extractedTime}");
>
> appears to get executed before the regular expression post-processor, 
> rather than after.  For example, assume 2 http samplers in a row, with

> both having:
>   1.  a regular expression post-processor that retrieves a value for 
> extractedTime from the returned html page
>   2.  a beanshell post-processor that contains the value above The 
> value written into the listener file for the first sampler will 
> contain
>    ${extractedTime}
> for the response message
> The value written into the listener file for the second sampler will 
> contain 4.233 which is the extractedTime value that was gleaned from 
> the first sampler's regular expression.
>
> Either the beanshell script gets executed before the regular 
> expression post processor, or "prev" refers to the results from the 
> prior sample, rather than the results from the current sample.
>
> Can you let me know if there is a way to get the value written into 
> the response message to correspond to the value gleaned from the 
> current sample via a regular expression post processor?
>
> Thanks for your help!
>
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Friday, December 08, 2006 11:36 AM
> To: JMeter Users List
> Subject: Re: Yet another extractor question
>
> This is mentioned in
> http://jakarta.apache.org/jmeter/usermanual/get-started.html.
>
> www.beanshell.org
>
>
>
>
> On 08/12/06, Christensen, Alan <al...@hp.com> wrote:
> > No.  Where do I get it?
> >
> > -----Original Message-----
> > From: sebb [mailto:sebbaz@gmail.com]
> > Sent: Friday, December 08, 2006 10:57 AM
> > To: JMeter Users List
> > Subject: Re: Yet another extractor question
> >
> > Did you download the beanshell jar and put it in the lib directory?
> >
> > On 08/12/06, Christensen, Alan <al...@hp.com> wrote:
> > > Hi Sebb-
> > >
> > > Your suggestion below sounded like a great idea.  However, when I 
> > > tried it, the sampler containing the beanshell processor did not 
> > > show up in the output in any way.
> > >
> > > The jmeter.log shows
> > > ShellPostProcessor: bsh.Interpreter
> > > 2006/12/08 08:37:52 INFO  - jmeter.threads.JMeterThread: Thread 
> > > Thread
> >
> > > Group 1-1 started
> > > 2006/12/08 08:38:06 ERROR - jmeter.threads.JMeterThread:
> > > java.lang.NullPointerException
> > >        at
> > > org.apache.jmeter.extractor.BeanShellPostProcessor.process(BeanShe
> > > ll
> > > Po
> > > st
> > > Processor.java:76)
> > >        at
> > >
> org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.
> > > ja
> > > va:428)
> > >        at
> > > org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
> > >        at java.lang.Thread.run(Unknown Source)
> > >
> > > I am using the exact method that you have below in my beanshell 
> > > post
>
> > > processor, i.e.
> > >
> > > prev.setResponseMessage("${extractedTime}");
> > >
> > > It is the only line in the beanshell post processor in the script
> > area.
> > > Do I need more?
> > >
> > > It doesn't seem to matter what I put inside the "" within the 
> > > parameter area of the method.  I can put "1" in there and it still

> > > returns the same error.
> > >
> > > Any suggestions?
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: sebb [mailto:sebbaz@gmail.com]
> > > Sent: Wednesday, December 06, 2006 2:32 PM
> > > To: JMeter Users List
> > > Subject: Re: Yet another extractor question
> > >
> > > On 06/12/06, Christensen, Alan <al...@hp.com> wrote:
> > > >  My returned html pages include a number in them that 
> > > > corresponds to
> >
> > > > the back end time that was associated with processing the
> > transaction.
> > >
> > > > I'd like to figure out how I can extract this number and then 
> > > > have
>
> > > > the
> > >
> > > > listeners log this number along with the other data logged for 
> > > > each transaction.  Is there an easy way to do this?  I know that

> > > > I
>
> > > > can extract a value from one sampler and append the extracted 
> > > > value to the
> > >
> > > > name field of the subsequent sampler.  But this associates the 
> > > > backend
> > >
> > > > time with the wrong line in the report.  Any suggestions?
> > >
> >
> > > At present it is not possible to add extra details to the fields 
> > > saved
> >
> > > by the listeners.
> > > [There is an enhancement request to add extra fields to the 
> > > listener
>
> > > data, but no work has been done on it.]
> > >
> > > However, you can use one of the existing fields, such as the 
> > > responseMessage, to store the value.
> > >
> > > This could be done using a BeanShell Post-processor, for example:
> > >
> > > prev.setResponseMessage("${extractedTime}");
> > >
> > >
> > > > ----------------------------------------------------------------
> > > > --
> > > > --
> > > > - To unsubscribe, e-mail:
> > > > jmeter-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail:
> > > > jmeter-user-help@jakarta.apache.org
> > > >
> > > >
> > >
> > > ------------------------------------------------------------------
> > > --
> > > - To unsubscribe, e-mail: 
> > > jmeter-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: 
> > > jmeter-user-help@jakarta.apache.org
> > >
> > >
> > > ------------------------------------------------------------------
> > > --
> > > - To unsubscribe, e-mail: 
> > > jmeter-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: 
> > > jmeter-user-help@jakarta.apache.org
> > >
> > >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


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


Re: Yet another extractor question

Posted by sebb <se...@gmail.com>.
It was discovered a few months back that JMeter runs Post-Processors
in reverse order - no idea why - but I forgot to create a Bugzilla
issue.

I have now:

http://issues.apache.org/bugzilla/show_bug.cgi?id=41140

The bug has yet to be corrected.

Try reversing the order of the Post-Processors - that should fix it.

S.

On 09/12/06, Christensen, Alan <al...@hp.com> wrote:
> That solved my problem with the null pointer.  Now the problem is that
> the beanshell script
>
>    prev.setResponseMessage("${extractedTime}");
>
> appears to get executed before the regular expression post-processor,
> rather than after.  For example, assume 2 http samplers in a row, with
> both having:
>   1.  a regular expression post-processor that retrieves a value for
> extractedTime from the returned html page
>   2.  a beanshell post-processor that contains the value above
> The value written into the listener file for the first sampler will
> contain
>    ${extractedTime}
> for the response message
> The value written into the listener file for the second sampler will
> contain 4.233 which is the extractedTime value that was gleaned from the
> first sampler's regular expression.
>
> Either the beanshell script gets executed before the regular expression
> post processor, or "prev" refers to the results from the prior sample,
> rather than the results from the current sample.
>
> Can you let me know if there is a way to get the value written into the
> response message to correspond to the value gleaned from the current
> sample via a regular expression post processor?
>
> Thanks for your help!
>
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Friday, December 08, 2006 11:36 AM
> To: JMeter Users List
> Subject: Re: Yet another extractor question
>
> This is mentioned in
> http://jakarta.apache.org/jmeter/usermanual/get-started.html.
>
> www.beanshell.org
>
>
>
>
> On 08/12/06, Christensen, Alan <al...@hp.com> wrote:
> > No.  Where do I get it?
> >
> > -----Original Message-----
> > From: sebb [mailto:sebbaz@gmail.com]
> > Sent: Friday, December 08, 2006 10:57 AM
> > To: JMeter Users List
> > Subject: Re: Yet another extractor question
> >
> > Did you download the beanshell jar and put it in the lib directory?
> >
> > On 08/12/06, Christensen, Alan <al...@hp.com> wrote:
> > > Hi Sebb-
> > >
> > > Your suggestion below sounded like a great idea.  However, when I
> > > tried it, the sampler containing the beanshell processor did not
> > > show up in the output in any way.
> > >
> > > The jmeter.log shows
> > > ShellPostProcessor: bsh.Interpreter
> > > 2006/12/08 08:37:52 INFO  - jmeter.threads.JMeterThread: Thread
> > > Thread
> >
> > > Group 1-1 started
> > > 2006/12/08 08:38:06 ERROR - jmeter.threads.JMeterThread:
> > > java.lang.NullPointerException
> > >        at
> > > org.apache.jmeter.extractor.BeanShellPostProcessor.process(BeanShell
> > > Po
> > > st
> > > Processor.java:76)
> > >        at
> > >
> org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.
> > > ja
> > > va:428)
> > >        at
> > > org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
> > >        at java.lang.Thread.run(Unknown Source)
> > >
> > > I am using the exact method that you have below in my beanshell post
>
> > > processor, i.e.
> > >
> > > prev.setResponseMessage("${extractedTime}");
> > >
> > > It is the only line in the beanshell post processor in the script
> > area.
> > > Do I need more?
> > >
> > > It doesn't seem to matter what I put inside the "" within the
> > > parameter area of the method.  I can put "1" in there and it still
> > > returns the same error.
> > >
> > > Any suggestions?
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: sebb [mailto:sebbaz@gmail.com]
> > > Sent: Wednesday, December 06, 2006 2:32 PM
> > > To: JMeter Users List
> > > Subject: Re: Yet another extractor question
> > >
> > > On 06/12/06, Christensen, Alan <al...@hp.com> wrote:
> > > >  My returned html pages include a number in them that corresponds
> > > > to
> >
> > > > the back end time that was associated with processing the
> > transaction.
> > >
> > > > I'd like to figure out how I can extract this number and then have
>
> > > > the
> > >
> > > > listeners log this number along with the other data logged for
> > > > each transaction.  Is there an easy way to do this?  I know that I
>
> > > > can extract a value from one sampler and append the extracted
> > > > value to the
> > >
> > > > name field of the subsequent sampler.  But this associates the
> > > > backend
> > >
> > > > time with the wrong line in the report.  Any suggestions?
> > >
> >
> > > At present it is not possible to add extra details to the fields
> > > saved
> >
> > > by the listeners.
> > > [There is an enhancement request to add extra fields to the listener
>
> > > data, but no work has been done on it.]
> > >
> > > However, you can use one of the existing fields, such as the
> > > responseMessage, to store the value.
> > >
> > > This could be done using a BeanShell Post-processor, for example:
> > >
> > > prev.setResponseMessage("${extractedTime}");
> > >
> > >
> > > > ------------------------------------------------------------------
> > > > --
> > > > - To unsubscribe, e-mail:
> > > > jmeter-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail:
> > > > jmeter-user-help@jakarta.apache.org
> > > >
> > > >
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> > >
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


RE: Yet another extractor question

Posted by "Christensen, Alan" <al...@hp.com>.
That solved my problem with the null pointer.  Now the problem is that
the beanshell script

    prev.setResponseMessage("${extractedTime}");

appears to get executed before the regular expression post-processor,
rather than after.  For example, assume 2 http samplers in a row, with
both having:
   1.  a regular expression post-processor that retrieves a value for
extractedTime from the returned html page
   2.  a beanshell post-processor that contains the value above
The value written into the listener file for the first sampler will
contain 
    ${extractedTime} 
for the response message
The value written into the listener file for the second sampler will
contain 4.233 which is the extractedTime value that was gleaned from the
first sampler's regular expression.

Either the beanshell script gets executed before the regular expression
post processor, or "prev" refers to the results from the prior sample,
rather than the results from the current sample.

Can you let me know if there is a way to get the value written into the
response message to correspond to the value gleaned from the current
sample via a regular expression post processor?

Thanks for your help!
    

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Friday, December 08, 2006 11:36 AM
To: JMeter Users List
Subject: Re: Yet another extractor question

This is mentioned in
http://jakarta.apache.org/jmeter/usermanual/get-started.html.

www.beanshell.org




On 08/12/06, Christensen, Alan <al...@hp.com> wrote:
> No.  Where do I get it?
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Friday, December 08, 2006 10:57 AM
> To: JMeter Users List
> Subject: Re: Yet another extractor question
>
> Did you download the beanshell jar and put it in the lib directory?
>
> On 08/12/06, Christensen, Alan <al...@hp.com> wrote:
> > Hi Sebb-
> >
> > Your suggestion below sounded like a great idea.  However, when I 
> > tried it, the sampler containing the beanshell processor did not 
> > show up in the output in any way.
> >
> > The jmeter.log shows
> > ShellPostProcessor: bsh.Interpreter
> > 2006/12/08 08:37:52 INFO  - jmeter.threads.JMeterThread: Thread 
> > Thread
>
> > Group 1-1 started
> > 2006/12/08 08:38:06 ERROR - jmeter.threads.JMeterThread:
> > java.lang.NullPointerException
> >        at
> > org.apache.jmeter.extractor.BeanShellPostProcessor.process(BeanShell
> > Po
> > st
> > Processor.java:76)
> >        at
> >
org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.
> > ja
> > va:428)
> >        at
> > org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
> >        at java.lang.Thread.run(Unknown Source)
> >
> > I am using the exact method that you have below in my beanshell post

> > processor, i.e.
> >
> > prev.setResponseMessage("${extractedTime}");
> >
> > It is the only line in the beanshell post processor in the script
> area.
> > Do I need more?
> >
> > It doesn't seem to matter what I put inside the "" within the 
> > parameter area of the method.  I can put "1" in there and it still 
> > returns the same error.
> >
> > Any suggestions?
> >
> >
> >
> > -----Original Message-----
> > From: sebb [mailto:sebbaz@gmail.com]
> > Sent: Wednesday, December 06, 2006 2:32 PM
> > To: JMeter Users List
> > Subject: Re: Yet another extractor question
> >
> > On 06/12/06, Christensen, Alan <al...@hp.com> wrote:
> > >  My returned html pages include a number in them that corresponds 
> > > to
>
> > > the back end time that was associated with processing the
> transaction.
> >
> > > I'd like to figure out how I can extract this number and then have

> > > the
> >
> > > listeners log this number along with the other data logged for 
> > > each transaction.  Is there an easy way to do this?  I know that I

> > > can extract a value from one sampler and append the extracted 
> > > value to the
> >
> > > name field of the subsequent sampler.  But this associates the 
> > > backend
> >
> > > time with the wrong line in the report.  Any suggestions?
> >
>
> > At present it is not possible to add extra details to the fields 
> > saved
>
> > by the listeners.
> > [There is an enhancement request to add extra fields to the listener

> > data, but no work has been done on it.]
> >
> > However, you can use one of the existing fields, such as the 
> > responseMessage, to store the value.
> >
> > This could be done using a BeanShell Post-processor, for example:
> >
> > prev.setResponseMessage("${extractedTime}");
> >
> >
> > > ------------------------------------------------------------------
> > > --
> > > - To unsubscribe, e-mail: 
> > > jmeter-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: 
> > > jmeter-user-help@jakarta.apache.org
> > >
> > >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


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


Re: Yet another extractor question

Posted by sebb <se...@gmail.com>.
This is mentioned in
http://jakarta.apache.org/jmeter/usermanual/get-started.html.

www.beanshell.org




On 08/12/06, Christensen, Alan <al...@hp.com> wrote:
> No.  Where do I get it?
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Friday, December 08, 2006 10:57 AM
> To: JMeter Users List
> Subject: Re: Yet another extractor question
>
> Did you download the beanshell jar and put it in the lib directory?
>
> On 08/12/06, Christensen, Alan <al...@hp.com> wrote:
> > Hi Sebb-
> >
> > Your suggestion below sounded like a great idea.  However, when I
> > tried it, the sampler containing the beanshell processor did not show
> > up in the output in any way.
> >
> > The jmeter.log shows
> > ShellPostProcessor: bsh.Interpreter
> > 2006/12/08 08:37:52 INFO  - jmeter.threads.JMeterThread: Thread Thread
>
> > Group 1-1 started
> > 2006/12/08 08:38:06 ERROR - jmeter.threads.JMeterThread:
> > java.lang.NullPointerException
> >        at
> > org.apache.jmeter.extractor.BeanShellPostProcessor.process(BeanShellPo
> > st
> > Processor.java:76)
> >        at
> > org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.
> > ja
> > va:428)
> >        at
> > org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
> >        at java.lang.Thread.run(Unknown Source)
> >
> > I am using the exact method that you have below in my beanshell post
> > processor, i.e.
> >
> > prev.setResponseMessage("${extractedTime}");
> >
> > It is the only line in the beanshell post processor in the script
> area.
> > Do I need more?
> >
> > It doesn't seem to matter what I put inside the "" within the
> > parameter area of the method.  I can put "1" in there and it still
> > returns the same error.
> >
> > Any suggestions?
> >
> >
> >
> > -----Original Message-----
> > From: sebb [mailto:sebbaz@gmail.com]
> > Sent: Wednesday, December 06, 2006 2:32 PM
> > To: JMeter Users List
> > Subject: Re: Yet another extractor question
> >
> > On 06/12/06, Christensen, Alan <al...@hp.com> wrote:
> > >  My returned html pages include a number in them that corresponds to
>
> > > the back end time that was associated with processing the
> transaction.
> >
> > > I'd like to figure out how I can extract this number and then have
> > > the
> >
> > > listeners log this number along with the other data logged for each
> > > transaction.  Is there an easy way to do this?  I know that I can
> > > extract a value from one sampler and append the extracted value to
> > > the
> >
> > > name field of the subsequent sampler.  But this associates the
> > > backend
> >
> > > time with the wrong line in the report.  Any suggestions?
> >
>
> > At present it is not possible to add extra details to the fields saved
>
> > by the listeners.
> > [There is an enhancement request to add extra fields to the listener
> > data, but no work has been done on it.]
> >
> > However, you can use one of the existing fields, such as the
> > responseMessage, to store the value.
> >
> > This could be done using a BeanShell Post-processor, for example:
> >
> > prev.setResponseMessage("${extractedTime}");
> >
> >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


RE: Yet another extractor question

Posted by "Christensen, Alan" <al...@hp.com>.
No.  Where do I get it? 

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Friday, December 08, 2006 10:57 AM
To: JMeter Users List
Subject: Re: Yet another extractor question

Did you download the beanshell jar and put it in the lib directory?

On 08/12/06, Christensen, Alan <al...@hp.com> wrote:
> Hi Sebb-
>
> Your suggestion below sounded like a great idea.  However, when I 
> tried it, the sampler containing the beanshell processor did not show 
> up in the output in any way.
>
> The jmeter.log shows
> ShellPostProcessor: bsh.Interpreter
> 2006/12/08 08:37:52 INFO  - jmeter.threads.JMeterThread: Thread Thread

> Group 1-1 started
> 2006/12/08 08:38:06 ERROR - jmeter.threads.JMeterThread:
> java.lang.NullPointerException
>        at
> org.apache.jmeter.extractor.BeanShellPostProcessor.process(BeanShellPo
> st
> Processor.java:76)
>        at
> org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.
> ja
> va:428)
>        at
> org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
>        at java.lang.Thread.run(Unknown Source)
>
> I am using the exact method that you have below in my beanshell post 
> processor, i.e.
>
> prev.setResponseMessage("${extractedTime}");
>
> It is the only line in the beanshell post processor in the script
area.
> Do I need more?
>
> It doesn't seem to matter what I put inside the "" within the 
> parameter area of the method.  I can put "1" in there and it still 
> returns the same error.
>
> Any suggestions?
>
>
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Wednesday, December 06, 2006 2:32 PM
> To: JMeter Users List
> Subject: Re: Yet another extractor question
>
> On 06/12/06, Christensen, Alan <al...@hp.com> wrote:
> >  My returned html pages include a number in them that corresponds to

> > the back end time that was associated with processing the
transaction.
>
> > I'd like to figure out how I can extract this number and then have 
> > the
>
> > listeners log this number along with the other data logged for each 
> > transaction.  Is there an easy way to do this?  I know that I can 
> > extract a value from one sampler and append the extracted value to 
> > the
>
> > name field of the subsequent sampler.  But this associates the 
> > backend
>
> > time with the wrong line in the report.  Any suggestions?
>

> At present it is not possible to add extra details to the fields saved

> by the listeners.
> [There is an enhancement request to add extra fields to the listener 
> data, but no work has been done on it.]
>
> However, you can use one of the existing fields, such as the 
> responseMessage, to store the value.
>
> This could be done using a BeanShell Post-processor, for example:
>
> prev.setResponseMessage("${extractedTime}");
>
>
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


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


Re: Yet another extractor question

Posted by sebb <se...@gmail.com>.
Did you download the beanshell jar and put it in the lib directory?

On 08/12/06, Christensen, Alan <al...@hp.com> wrote:
> Hi Sebb-
>
> Your suggestion below sounded like a great idea.  However, when I tried
> it, the sampler containing the beanshell processor did not show up in
> the output in any way.
>
> The jmeter.log shows
> ShellPostProcessor: bsh.Interpreter
> 2006/12/08 08:37:52 INFO  - jmeter.threads.JMeterThread: Thread Thread
> Group 1-1 started
> 2006/12/08 08:38:06 ERROR - jmeter.threads.JMeterThread:
> java.lang.NullPointerException
>        at
> org.apache.jmeter.extractor.BeanShellPostProcessor.process(BeanShellPost
> Processor.java:76)
>        at
> org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.ja
> va:428)
>        at
> org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
>        at java.lang.Thread.run(Unknown Source)
>
> I am using the exact method that you have below in my beanshell post
> processor, i.e.
>
> prev.setResponseMessage("${extractedTime}");
>
> It is the only line in the beanshell post processor in the script area.
> Do I need more?
>
> It doesn't seem to matter what I put inside the "" within the parameter
> area of the method.  I can put "1" in there and it still returns the
> same error.
>
> Any suggestions?
>
>
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Wednesday, December 06, 2006 2:32 PM
> To: JMeter Users List
> Subject: Re: Yet another extractor question
>
> On 06/12/06, Christensen, Alan <al...@hp.com> wrote:
> >  My returned html pages include a number in them that corresponds to
> > the back end time that was associated with processing the transaction.
>
> > I'd like to figure out how I can extract this number and then have the
>
> > listeners log this number along with the other data logged for each
> > transaction.  Is there an easy way to do this?  I know that I can
> > extract a value from one sampler and append the extracted value to the
>
> > name field of the subsequent sampler.  But this associates the backend
>
> > time with the wrong line in the report.  Any suggestions?
>

> At present it is not possible to add extra details to the fields saved
> by the listeners.
> [There is an enhancement request to add extra fields to the listener
> data, but no work has been done on it.]
>
> However, you can use one of the existing fields, such as the
> responseMessage, to store the value.
>
> This could be done using a BeanShell Post-processor, for example:
>
> prev.setResponseMessage("${extractedTime}");
>
>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


RE: Yet another extractor question

Posted by "Christensen, Alan" <al...@hp.com>.
Hi Sebb-

Your suggestion below sounded like a great idea.  However, when I tried
it, the sampler containing the beanshell processor did not show up in
the output in any way. 
 
The jmeter.log shows
ShellPostProcessor: bsh.Interpreter 
2006/12/08 08:37:52 INFO  - jmeter.threads.JMeterThread: Thread Thread
Group 1-1 started 
2006/12/08 08:38:06 ERROR - jmeter.threads.JMeterThread:
java.lang.NullPointerException
	at
org.apache.jmeter.extractor.BeanShellPostProcessor.process(BeanShellPost
Processor.java:76)
	at
org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.ja
va:428)
	at
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
	at java.lang.Thread.run(Unknown Source)

I am using the exact method that you have below in my beanshell post
processor, i.e.  

prev.setResponseMessage("${extractedTime}"); 

It is the only line in the beanshell post processor in the script area.
Do I need more?

It doesn't seem to matter what I put inside the "" within the parameter
area of the method.  I can put "1" in there and it still returns the
same error.  

Any suggestions?

  

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Wednesday, December 06, 2006 2:32 PM
To: JMeter Users List
Subject: Re: Yet another extractor question

On 06/12/06, Christensen, Alan <al...@hp.com> wrote:
>  My returned html pages include a number in them that corresponds to 
> the back end time that was associated with processing the transaction.

> I'd like to figure out how I can extract this number and then have the

> listeners log this number along with the other data logged for each 
> transaction.  Is there an easy way to do this?  I know that I can 
> extract a value from one sampler and append the extracted value to the

> name field of the subsequent sampler.  But this associates the backend

> time with the wrong line in the report.  Any suggestions?

At present it is not possible to add extra details to the fields saved
by the listeners.
[There is an enhancement request to add extra fields to the listener
data, but no work has been done on it.]

However, you can use one of the existing fields, such as the
responseMessage, to store the value.

This could be done using a BeanShell Post-processor, for example:

prev.setResponseMessage("${extractedTime}");


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

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


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


Re: Yet another extractor question

Posted by sebb <se...@gmail.com>.
On 06/12/06, Christensen, Alan <al...@hp.com> wrote:
>  My returned html pages include a number in them that corresponds to the
> back end time that was associated with processing the transaction.  I'd
> like to figure out how I can extract this number and then have the
> listeners log this number along with the other data logged for each
> transaction.  Is there an easy way to do this?  I know that I can
> extract a value from one sampler and append the extracted value to the
> name field of the subsequent sampler.  But this associates the backend
> time with the wrong line in the report.  Any suggestions?

At present it is not possible to add extra details to the fields saved
by the listeners.
[There is an enhancement request to add extra fields to the listener
data, but no work has been done on it.]

However, you can use one of the existing fields, such as the
responseMessage, to store the value.

This could be done using a BeanShell Post-processor, for example:

prev.setResponseMessage("${extractedTime}");


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

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


Re: Simulating real browser behavior

Posted by sebb <se...@gmail.com>.
On 06/12/06, Christensen, Alan <al...@hp.com> wrote:
> A second question along the lines of the one below.  Is there a way to
> easily simulate cached behavior in a browser?  If you check the box at

Not at present. There is an outstanding enhancement request to support caching.

> the bottom of the http sampler, it appears that all embedded objects
> will be retrieved every time the sampler executes.  In a real world
> case, many (but probably not all) of the embedded content objects will
> be cacheable.  What would be ideal, would be to force the sampler to
> fetch the cacheable content on the first pass, but not on successive
> passes.   Is there any way to simulate this other than to identify the
> non-cacheable items and include them explicitly in their own samplers?

Not automatically at present.

> If this technique is used, then how would you combine the response times
> for the content items with the response time for the html page to get an
> overall response time?

This already happens for automatic downloads.

If loaded separately, use a Transaction Controller.


> -----Original Message-----
> From: Christensen, Alan
> Sent: Wednesday, December 06, 2006 2:40 PM
> To: JMeter Users List
> Subject: Simulating real browser behavior
>
> I have used Jmeter in the past to simply download html pages.  I have
> never dealt with the problem of downloading embedded content.  I know
> that the http sampler will allow me to force the download of embedded
> content by checking a box at the bottom.  However, this does not result
> in behavior that is similar to the way that browsers work.  In

JMeter is not a browser ...

> particular, Jmeter appears to request these items one at a time in
> serial fashion.  This is not the way that browsers work.  Browsers often
> request many content items in parallel.  The number of parallel
> retrievals is dependent upon the browser settings and where the content
> items are located.  Is there a way for Jmeter to work similarly, or does

No

> its structure require it to request items one at a time?  If there is a

Yes

> mechanism to do this, does it preserve the ability to measure the
> performance of the entire transaction, i.e., from the first request to
> the final piece of embedded content arriving back at Jmeter?

N/A

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

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


RE: Simulating real browser behavior

Posted by "Christensen, Alan" <al...@hp.com>.
A second question along the lines of the one below.  Is there a way to
easily simulate cached behavior in a browser?  If you check the box at
the bottom of the http sampler, it appears that all embedded objects
will be retrieved every time the sampler executes.  In a real world
case, many (but probably not all) of the embedded content objects will
be cacheable.  What would be ideal, would be to force the sampler to
fetch the cacheable content on the first pass, but not on successive
passes.   Is there any way to simulate this other than to identify the
non-cacheable items and include them explicitly in their own samplers?
If this technique is used, then how would you combine the response times
for the content items with the response time for the html page to get an
overall response time?  

-----Original Message-----
From: Christensen, Alan 
Sent: Wednesday, December 06, 2006 2:40 PM
To: JMeter Users List
Subject: Simulating real browser behavior

I have used Jmeter in the past to simply download html pages.  I have
never dealt with the problem of downloading embedded content.  I know
that the http sampler will allow me to force the download of embedded
content by checking a box at the bottom.  However, this does not result
in behavior that is similar to the way that browsers work.  In
particular, Jmeter appears to request these items one at a time in
serial fashion.  This is not the way that browsers work.  Browsers often
request many content items in parallel.  The number of parallel
retrievals is dependent upon the browser settings and where the content
items are located.  Is there a way for Jmeter to work similarly, or does
its structure require it to request items one at a time?  If there is a
mechanism to do this, does it preserve the ability to measure the
performance of the entire transaction, i.e., from the first request to
the final piece of embedded content arriving back at Jmeter?

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


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


Simulating real browser behavior

Posted by "Christensen, Alan" <al...@hp.com>.
I have used Jmeter in the past to simply download html pages.  I have
never dealt with the problem of downloading embedded content.  I know
that the http sampler will allow me to force the download of embedded
content by checking a box at the bottom.  However, this does not result
in behavior that is similar to the way that browsers work.  In
particular, Jmeter appears to request these items one at a time in
serial fashion.  This is not the way that browsers work.  Browsers often
request many content items in parallel.  The number of parallel
retrievals is dependent upon the browser settings and where the content
items are located.  Is there a way for Jmeter to work similarly, or does
its structure require it to request items one at a time?  If there is a
mechanism to do this, does it preserve the ability to measure the
performance of the entire transaction, i.e., from the first request to
the final piece of embedded content arriving back at Jmeter?

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


Re: Yet another extractor question

Posted by sebb <se...@gmail.com>.
On 06/12/06, Kyle Schmitt <ky...@gmail.com> wrote:
> Well, my take would be to copy and paste a representative sample of
> the generated html into this
> applet(http://jakarta.apache.org/oro/demo.html), then write a regular
> expression that finds that number. (you probably already know that
> part)
>
> It's silly, but to see the result of the regex in my test, I've been
> inserting empty http samplers with the name set to the ${variable} I
> snag with my regular expression.

Not silly - you can also use a Java Sampler for this.

> It may not be kosher, but maybe you could put a response assertion
> that checked for that regex after it's been snagged?
>
> Just a newbie's advice all the same!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


Re: Yet another extractor question

Posted by Kyle Schmitt <ky...@gmail.com>.
Well, my take would be to copy and paste a representative sample of
the generated html into this
applet(http://jakarta.apache.org/oro/demo.html), then write a regular
expression that finds that number. (you probably already know that
part)

It's silly, but to see the result of the regex in my test, I've been
inserting empty http samplers with the name set to the ${variable} I
snag with my regular expression.

It may not be kosher, but maybe you could put a response assertion
that checked for that regex after it's been snagged?

Just a newbie's advice all the same!

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