You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by Aaron Phillips <aa...@imagesoft.fiserv.com> on 2002/04/23 00:59:48 UTC

Design question regarding sampling

Hi all,

I have done some looking into JMeter to see if it will fit a need in our
company to load test our image archival system.  I seem to be hitting a
brick wall though due to the inherent design of JMeter.  Let me explain:

JMeter is based on the principle of a Sample.  Every test instance is
entirely contained in a single sample.  There is no concept of a test
which has state accross samples.  
Let me give an example:  The HTTP sampler module that is already built
into JMeter... for each sample a new connection is made, the request
sent, and the connection closed.  This repeats 100 times if the loop
specifies 100 iterations.

My problem is that I would like to save state accross samples.  Using
the example mentioned above, I would like to only have to open the
connection once, then execute 100 HTTP requests, then close the
connection (again, only once).  Is there a way to do this that is clear
and not a workaround?

There are two approaches I have considered, both are not too good:
1) Compress all the samples into a single sampler (i.e. inside the
sample method the sampling iteration will occur).  This is bad because
we then loose the granularity of reporting back sample results.  We can
only report at the end of all 100 samples, to use the HTTP example.
2) Break the entire test case into 3 samplers: 
    1-open the connection
    (loop controller -- 100 iterations)
    2-sample once (a single HTTP request)
    (end loop)
    3-close connection
This approach seems flawed though because neither the 2nd or 3rd sampler
is in the scope of the connection object opened by the 1st.  (I realize
that we could get around this by adding state information like the
connection object to the config object, which is in fact in scope, but
this seems like a dirty way to do it) 

If I am wrong in the design assessment, I would like to know.  By the
way, I think the product is very good and am quite impressed with the
overall design and the straighforward coding.

Kind Regards,
Aaron Phillips



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