You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Jason Fisher <jf...@ign.com> on 2002/09/27 03:42:59 UTC

Extending JMeter with a new generative controller

I want to create what I think would be a valuable tool for others as well.
I would like to extend JMeter and create a Generative Controller that reads
an Apache log file and sends HTTP requests to a given host with the GET or
POST params from the requests in the log file.  
It would funtion just like the HTTP Request controller that comes with
JMeter, except that instead of always calling the same URL it would always
just read the next line of the log.  Instead of an input field for 'path' it
would have an input field for where to get the Apache log file to use.  
This tool would allow me to re-simulate the exact requests made to a real
server over the course of time.  I might even want to add another component
that causes the requests to be generated with the same relative frequency as
the requests in the logs.

My problem is that I am having trouble figuring out how to create this
class.  I had a hunch that the HTTP Request generative controller was likely
a single java object somewhere, but I've perused the source quite a bit and
I can't see anything that would fit (I was hoping to maybe just bastardize
that object a bit to save coding time).  
Are the generative controllers that come with JMeter single java objects?
If so, which ones are they?  Also, are there any good examples of how to
something like what I want to do?  The developer's manual has some good
information but the learning curve looks a bit steep to have to climb just
to create this one simple class.  

Any help would be greatly appreciated.

Thanks,
Jason Fisher
Software Engineer

Re: Extending JMeter with a new generative controller

Posted by Jordi Salvat i Alabart <js...@atg.com>.
The proxy recorder has been there since I can remember. The one in the 
latest versions works better (more translarently) in some circumstances.

The trick is that you need to create it in your "workbench", not in your 
"test plan".

Salut,

Jordi.


Andrea Trasatti wrote:
> what is the proxy recording component? Is it in the nightly?
> 
> Thanks
> 
> On 27 Sep 2002 at 12:14, Mike Stover wrote:
> 
> 
>>Have you used the proxy recording component to record your browser actions?
> 
> 
> 
> 
> ===================
> Andrea Trasatti
> BWARE TECHNOLOGIES
> via San Gregorio, 3 - 20124 Milan - Italy
> http://www.bware.it
> Tel. +39 02 2779181
> Fax +39 02 27791828
> Cell. +39 335 7866749
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Extending JMeter with a new generative controller

Posted by Andrea Trasatti <tr...@bware.it>.
what is the proxy recording component? Is it in the nightly?

Thanks

On 27 Sep 2002 at 12:14, Mike Stover wrote:

> Have you used the proxy recording component to record your browser actions?



===================
Andrea Trasatti
BWARE TECHNOLOGIES
via San Gregorio, 3 - 20124 Milan - Italy
http://www.bware.it
Tel. +39 02 2779181
Fax +39 02 27791828
Cell. +39 335 7866749



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Extending JMeter with a new generative controller

Posted by Mike Stover <ms...@apache.org>.
This is a good suggestion.

-Mike

On 27 Sep 2002 at 13:50, Eric Siegerman wrote:

> On Fri, Sep 27, 2002 at 12:14:03PM -0400, Mike Stover wrote:
> > Have you used the proxy recording component to record your browser actions?
> > 
> > On 26 Sep 2002 at 18:42, Jason Fisher wrote:
> > 
> > > I want to create what I think would be a valuable tool for others as well.
> > > I would like to extend JMeter and create a Generative Controller that reads
> > > an Apache log file and sends HTTP requests to a given host with the GET or
> > > POST params from the requests in the log file.  
> 
> The proxy's very useful, but only for capturing one's own use of
> the target site.  Jason's log reader would make it easy to replay
> a period of production use, after the fact.  A couple of uses
> come to mind:
>   - You could load-test what real users have actually done,
>     rather than just what you imagine they might do
> 
>   - If something interesting happens (e.g. your site crashes due
>     to load, or starts spitting out erroneous pages), you could
>     more easily turn the sequence that caused the failure into a
>     regression-test case -- even if the sequence is thousands of
>     requests long
> 
> However, it seems to me that the log reader should act more like
> the proxy than like HTTP Request.  That is, it shouldn't be a
> sampler, which is used during a test run to generate actual
> requests to the target site.  Instead, it should be used
> *outside* of a test run to write a test plan, as the proxy does.
> Advantages:
>   - One could edit the resulting test plan (fine tuning, adding
>     assertions, arranging to log in the users first, etc.),
>     rather than being constrained to replay *exactly* what's in
>     the log
> 
>   - One wouldn't pay the overhead of reading and parsing the log
>     file during real-time testing
> 
>   - If the log reader were a sampler, one would have to store the
>     Apache log files along with the test plans that use them.
>     With the log reader as a test-plan generator, the Apache log
>     is only needed temporarily; you can trash it once you've
>     saved the .jmx file
> 
>   - It just conceptually feels like the Right Thing
> 
> 
> --
> 
> |  | /\
> |-_|/  >   Eric Siegerman, Toronto, Ont.        erics@telepres.com
> |  |  /
> The acronym for "the powers that be" differs by only one letter
> from that for "the pointy-haired boss".
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Extending JMeter with a new generative controller

Posted by Eric Siegerman <er...@telepres.com>.
On Fri, Sep 27, 2002 at 12:14:03PM -0400, Mike Stover wrote:
> Have you used the proxy recording component to record your browser actions?
> 
> On 26 Sep 2002 at 18:42, Jason Fisher wrote:
> 
> > I want to create what I think would be a valuable tool for others as well.
> > I would like to extend JMeter and create a Generative Controller that reads
> > an Apache log file and sends HTTP requests to a given host with the GET or
> > POST params from the requests in the log file.  

The proxy's very useful, but only for capturing one's own use of
the target site.  Jason's log reader would make it easy to replay
a period of production use, after the fact.  A couple of uses
come to mind:
  - You could load-test what real users have actually done,
    rather than just what you imagine they might do

  - If something interesting happens (e.g. your site crashes due
    to load, or starts spitting out erroneous pages), you could
    more easily turn the sequence that caused the failure into a
    regression-test case -- even if the sequence is thousands of
    requests long

However, it seems to me that the log reader should act more like
the proxy than like HTTP Request.  That is, it shouldn't be a
sampler, which is used during a test run to generate actual
requests to the target site.  Instead, it should be used
*outside* of a test run to write a test plan, as the proxy does.
Advantages:
  - One could edit the resulting test plan (fine tuning, adding
    assertions, arranging to log in the users first, etc.),
    rather than being constrained to replay *exactly* what's in
    the log

  - One wouldn't pay the overhead of reading and parsing the log
    file during real-time testing

  - If the log reader were a sampler, one would have to store the
    Apache log files along with the test plans that use them.
    With the log reader as a test-plan generator, the Apache log
    is only needed temporarily; you can trash it once you've
    saved the .jmx file

  - It just conceptually feels like the Right Thing


--

|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        erics@telepres.com
|  |  /
The acronym for "the powers that be" differs by only one letter
from that for "the pointy-haired boss".

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Extending JMeter with a new generative controller

Posted by Mike Stover <ms...@apache.org>.
Have you used the proxy recording component to record your browser actions?

-Mike

On 26 Sep 2002 at 18:42, Jason Fisher wrote:

> I want to create what I think would be a valuable tool for others as well.
> I would like to extend JMeter and create a Generative Controller that reads
> an Apache log file and sends HTTP requests to a given host with the GET or
> POST params from the requests in the log file.  
> It would funtion just like the HTTP Request controller that comes with
> JMeter, except that instead of always calling the same URL it would always
> just read the next line of the log.  Instead of an input field for 'path' it
> would have an input field for where to get the Apache log file to use.  
> This tool would allow me to re-simulate the exact requests made to a real
> server over the course of time.  I might even want to add another component
> that causes the requests to be generated with the same relative frequency as
> the requests in the logs.
> 
> My problem is that I am having trouble figuring out how to create this
> class.  I had a hunch that the HTTP Request generative controller was likely
> a single java object somewhere, but I've perused the source quite a bit and
> I can't see anything that would fit (I was hoping to maybe just bastardize
> that object a bit to save coding time).  
> Are the generative controllers that come with JMeter single java objects?
> If so, which ones are they?  Also, are there any good examples of how to
> something like what I want to do?  The developer's manual has some good
> information but the learning curve looks a bit steep to have to climb just
> to create this one simple class.  
> 
> Any help would be greatly appreciated.
> 
> Thanks,
> Jason Fisher
> Software Engineer
> 



--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>