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 Anil Philip <an...@openwave.com> on 2005/01/17 23:39:43 UTC

sampler being created more than once??

I am writing a CorbaSampler (aka TCPSampler()).

In my SamplerGUI, am I creating the sampler in the correct place?

 

   public TestElement createTestElement()

    {

        CorbaSampler sampler = new CorbaSampler();

        modifyTestElement(sampler);

        return sampler;

    }

 

 

However I find that createTestElement() is indirectly called from several
places by JMeter (26 places!).

So after I initially create JMeter, I set some data in it. In the sample()
call, I try to retrieve the data but find that a *new* instance of
CorbaSampler() has been created! So that now my data is lost.

Thanks,

Anil Philip


Re: sampler being created more than once??

Posted by Peter Lin <wo...@gmail.com>.
I've profiled it in the past and it isn't as bad as it seems. though
it can throw people off.

peter


On Mon, 17 Jan 2005 22:34:45 -0600, Anil Philip
<an...@openwave.com> wrote:
> Yes, I am implementing it, configure(TestElement).
> My issue was the instance of Sampler being created more than once and losing
> data that had been set in it earlier.
> 
> -----Original Message-----
> From: Peter Lin [mailto:woolfel@gmail.com]
> Sent: Monday, January 17, 2005 6:45 PM
> To: JMeter Developers List
> Subject: Re: sampler being created more than once??
> 
> you also have to implement configure(TestElement)
> 
> JMeter's engine will use that method to configure the thread.
> 
> peter
> 
> On Mon, 17 Jan 2005 16:39:43 -0600, Anil Philip
> <an...@openwave.com> wrote:
> > I am writing a CorbaSampler (aka TCPSampler()).
> >
> > In my SamplerGUI, am I creating the sampler in the correct place?
> >
> >    public TestElement createTestElement()
> >
> >     {
> >
> >         CorbaSampler sampler = new CorbaSampler();
> >
> >         modifyTestElement(sampler);
> >
> >         return sampler;
> >
> >     }
> >
> > However I find that createTestElement() is indirectly called from several
> > places by JMeter (26 places!).
> >
> > So after I initially create JMeter, I set some data in it. In the sample()
> > call, I try to retrieve the data but find that a *new* instance of
> > CorbaSampler() has been created! So that now my data is lost.
> >
> > Thanks,
> >
> > Anil Philip
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> 
>

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


RE: sampler being created more than once??

Posted by Anil Philip <an...@openwave.com>.
Yes, I am implementing it, configure(TestElement). 
My issue was the instance of Sampler being created more than once and losing
data that had been set in it earlier.

-----Original Message-----
From: Peter Lin [mailto:woolfel@gmail.com] 
Sent: Monday, January 17, 2005 6:45 PM
To: JMeter Developers List
Subject: Re: sampler being created more than once??

you also have to implement configure(TestElement)

JMeter's engine will use that method to configure the thread.

peter


On Mon, 17 Jan 2005 16:39:43 -0600, Anil Philip
<an...@openwave.com> wrote:
> I am writing a CorbaSampler (aka TCPSampler()).
> 
> In my SamplerGUI, am I creating the sampler in the correct place?
> 
>    public TestElement createTestElement()
> 
>     {
> 
>         CorbaSampler sampler = new CorbaSampler();
> 
>         modifyTestElement(sampler);
> 
>         return sampler;
> 
>     }
> 
> However I find that createTestElement() is indirectly called from several
> places by JMeter (26 places!).
> 
> So after I initially create JMeter, I set some data in it. In the sample()
> call, I try to retrieve the data but find that a *new* instance of
> CorbaSampler() has been created! So that now my data is lost.
> 
> Thanks,
> 
> Anil Philip
> 
>

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


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


Re: sampler being created more than once??

Posted by Peter Lin <wo...@gmail.com>.
you also have to implement configure(TestElement)

JMeter's engine will use that method to configure the thread.

peter


On Mon, 17 Jan 2005 16:39:43 -0600, Anil Philip
<an...@openwave.com> wrote:
> I am writing a CorbaSampler (aka TCPSampler()).
> 
> In my SamplerGUI, am I creating the sampler in the correct place?
> 
>    public TestElement createTestElement()
> 
>     {
> 
>         CorbaSampler sampler = new CorbaSampler();
> 
>         modifyTestElement(sampler);
> 
>         return sampler;
> 
>     }
> 
> However I find that createTestElement() is indirectly called from several
> places by JMeter (26 places!).
> 
> So after I initially create JMeter, I set some data in it. In the sample()
> call, I try to retrieve the data but find that a *new* instance of
> CorbaSampler() has been created! So that now my data is lost.
> 
> Thanks,
> 
> Anil Philip
> 
>

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


Re: sampler being created more than once??

Posted by sebb <se...@gmail.com>.
On Mon, 17 Jan 2005 16:39:43 -0600, Anil Philip
<an...@openwave.com> wrote:
> I am writing a CorbaSampler (aka TCPSampler()).
> 
> In my SamplerGUI, am I creating the sampler in the correct place?

I don't think so.

GUI sampler classes should only do what is necessary to ensure that
the display agrees with the test element.

They should not create anything needed by the sampler, otherwise the
sampler won't work in non-GUI mode...
 
>    public TestElement createTestElement()
> 
>     {
> 
>         CorbaSampler sampler = new CorbaSampler();
> 
>         modifyTestElement(sampler);
> 
>         return sampler;
> 
>     }
> 
> However I find that createTestElement() is indirectly called from several
> places by JMeter (26 places!).
> 
> So after I initially create JMeter, I set some data in it. In the sample()
> call, I try to retrieve the data but find that a *new* instance of
> CorbaSampler() has been created! So that now my data is lost.

Not surprising ...!
 
> Thanks,
> 
> Anil Philip
> 
>

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