Ignoring the specifics of the example given ('cuz I have to agree with
Michael that it sounds like something which should be
done in one thread), some other tools have the capability to share data
between scripts, threads, or whatever (usually named something like Shared
Global Variables or something like that, maybe jmeter needs this also.  It's
usually pretty easy on a native system using shared memory, but I'm not sure
how to implement it with java...and then there's sharing the variables
between remote jmeter engines - that makes things _interesting_.

J

----- Original Message ----- 
From: "Michael Stover" <[EMAIL PROTECTED]>
To: "JMeter Developers List" <[EMAIL PROTECTED]>
Sent: Wednesday, September 22, 2004 8:21 AM
Subject: Re: Saving variables


> I must be seriously misunderstanding something because, to me, it sounds
> like you are describing a bunch of independent threads doing three
> sequential steps, which is exactly how JMeter works.  See my comments
> below:
>
> On Wed, 2004-09-22 at 05:35, [EMAIL PROTECTED] wrote:
> > I know that this mailing list is not meant for design, but if we already
> > started...
> >
> > I'm sorry, but I've to disagree. We're talking about client/server
> > architecture, I'm a client and I want to send maximum load to the
> > server.
> > In one thread architecture it will look like that:
> >
> > Thread(loop)
> >  |- Send TCP/IP message (to server)
> >  |
> >  |- Wait for TCP/IP Ack message (from server)
>
> Two sequential steps.
>
> >
> > In an implementation like that, there will be a situation called 'window
> > size = one', that means that the client can't send another message till
> > it gets an ack message from the server (it can send just one message
> > till the ack), and that reduces the load significantly (that's a fact),
> > I don't want to wait for the Acks, I want to keep sending.
>
> You say you don't want to wait, but you contradict that below.  In fact,
> it seems you have to wait.
>
> > by decoupling those processes I can also elaborate things, like I
> > described in the previous mail:
> >
> > Thread1(loop)
> >  |- Send message A
> >
> > Thread2(loop)
> >  |- Wait for Ack (save a special field - f1, push in shared Q)
> >
> > Thread3(loop)
> >  |- Send message B sometimes in the future (according to field f1 - pop
> >  from shared Q)
>
> Now you are describing three sequential steps, each dependent on the
> previous step.  For some reason, you want to use three threads and make
> them wait on one another (complicated) when a single thread will simply
> work that way.
>
> >
> > As you can see, I can't do it in one thread (I won't be able to send a
> > second message A till the B message will be send
>
> With a single thread, that's true, but a single thread is simulating a
> single client, and this is how clients work, no?  But add a second
> thread (second client), and now you have two 'message A' being sent
> simultaneously.  Add 500 threads, and you'll have 500 parallel message
> A's.
>
> >  - sometime in the
> > future). I want to send as much messages A in a second, as I can.
>
> I would like to see how you would do it with 3 threads, and keep each
> set of message A - Ack - message B together.  Certainly you can't do it
> in JMeter even with some global variable storage.
>
> -Mike
>
> >
> > And now for the real problem, you wrote: "Variables are not shared
> > across threads. JMeter simulates multiple independent users", That's
> > okay, I want to simulate it myself. like the "User Defined Variables" in
> > the Test Plan.
> >
> > Can you write something on how it is done (ValueReplacer...)
> >
> > Thanks a million
> >
> > P.S
> > I can always use global queue, but... you know
> >
> >
> >
> > On Tue, 21 Sep 2004 11:16:29 -0400, "Michael Stover"
> > <[EMAIL PROTECTED]> said:
> > > That seems like exactly the sort of thing you'd do in one thread.  An
> > > initial request gets some data and a subsequent request uses it.  How
> > > else would you manage 100 threads doing this?
> > >
> > > -Mike
> > >
> > > On Tue, 2004-09-21 at 10:53, [EMAIL PROTECTED] wrote:
> > > > Okay, so how can I do it?
> > > > What I'm planing, is to use in one thread, a derived
> > > > 'AbstractJavaSamplerClient' to get TCP/IP packet (a request) and to
pars
> > > > it. according to this request, another thread will send another
request
> > > > (let's say the ack part) - using other derived
> > > > 'AbstractJavaSamplerClient' that will be under an 'IfController' (in
the
> > > > 'IfController' the user will "ask" if a specific value equals to
> > > > something).
> > > > I don't think it's wise to do both process in the same thread.
> > > >
> > > > Thanks again, especially for your quick answer.
> > > >
> > > > On Tue, 21 Sep 2004 09:50:01 -0400, "Michael Stover"
> > > > <[EMAIL PROTECTED]> said:
> > > > > Variables are not shared across threads.  JMeter simulates
multiple
> > > > > independent users, so there hasn't been any need to shared data
amongst
> > > > > the threads during the test run.
> > > > >
> > > > > -Mike
> > > > >
> > > > > On Tue, 2004-09-21 at 09:27, [EMAIL PROTECTED] wrote:
> > > > > > I want to save variables that were initialized in one thread, so
they
> > > > > > will be seen in other thread.
> > > > > > There is an easy way to save variables in the thread's context:
> > > > > > JMeterContext context = getThreadContext();
> > > > > > JMeterVariables vars = context.getVariables();
> > > > > > vars.put(....
> > > > > >
> > > > > > But trying to save variables so they will be seen in all the
threads is
> > > > > > much harder, I looked at: PreCompiler.addNode(Object,HashTree)
> > > > > > and in my code tried naively to write:
> > > > > > JMeterContextService.getContext().getVariables().put("code",
"value");
> > > > > > but this key was unvisible in other threads. I've noticed that
there is
> > > > > > some action doing with an instance of 'ValueReplacer' in the
'addNode'
> > > > > > func, but still didn't figure to find out what to do.
> > > > > > Tips will be most welcom
> > > > > >
> > > > > > Thanks.
> > > > > -- 
> > > > > Michael Stover <[EMAIL PROTECTED]>
> > > > > Apache Software Foundation
> > > > >
> > > > >
> > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail:
[EMAIL PROTECTED]
> > > > >
> > > -- 
> > > Michael Stover <[EMAIL PROTECTED]>
> > > Apache Software Foundation
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> -- 
> Michael Stover <[EMAIL PROTECTED]>
> Apache Software Foundation
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to