Groovy OUT.println() in remote execution

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Groovy OUT.println() in remote execution

Ivan Rancati-3
Hello,

I have a couple of test plans (run in non-GUI mode), where I use a JSR223
sampler (groovy) to display on the console when a certain stage is reached.
For example, to indicate the setUp thread/s is/are complete:

OUT.println("the setUp Thread Group is completed\n")

This works locally, but of course not with remote execution. Is there an
equivalent way to display, on the controller's console, a similar message
when a remote has finished a thread, or some other stage is reached?

Thanks a lot and best regards,
Ivan
Reply | Threaded
Open this post in threaded view
|

Re: Groovy OUT.println() in remote execution

ra0077
Hi,

Have you try annotations like http://docs.grafana.org/reference/annotations/
?

Antonio

Le lun. 25 févr. 2019 à 15:00, Ivan Rancati <[hidden email]> a
écrit :

> Hello,
>
> I have a couple of test plans (run in non-GUI mode), where I use a JSR223
> sampler (groovy) to display on the console when a certain stage is reached.
> For example, to indicate the setUp thread/s is/are complete:
>
> OUT.println("the setUp Thread Group is completed\n")
>
> This works locally, but of course not with remote execution. Is there an
> equivalent way to display, on the controller's console, a similar message
> when a remote has finished a thread, or some other stage is reached?
>
> Thanks a lot and best regards,
> Ivan
>
Reply | Threaded
Open this post in threaded view
|

Re: Groovy OUT.println() in remote execution

Ivan Rancati-3
hi Antonio,

thanks, I'll try annotations for graphics.
However, my question was slightly different: how to get some information
displayed in real time during test execution. Apologies if it was unclear.
For the current project, I have a simple, ssh-only infrastructure, without
Grafana.

Best regards,
Ivan

On Mon, Feb 25, 2019 at 3:34 PM Antonio Gomes Rodrigues <[hidden email]>
wrote:

> Hi,
>
> Have you try annotations like
> http://docs.grafana.org/reference/annotations/
> ?
>
> Antonio
>
> Le lun. 25 févr. 2019 à 15:00, Ivan Rancati <[hidden email]> a
> écrit :
>
> > Hello,
> >
> > I have a couple of test plans (run in non-GUI mode), where I use a JSR223
> > sampler (groovy) to display on the console when a certain stage is
> reached.
> > For example, to indicate the setUp thread/s is/are complete:
> >
> > OUT.println("the setUp Thread Group is completed\n")
> >
> > This works locally, but of course not with remote execution. Is there an
> > equivalent way to display, on the controller's console, a similar message
> > when a remote has finished a thread, or some other stage is reached?
> >
> > Thanks a lot and best regards,
> > Ivan
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Groovy OUT.println() in remote execution

Elke
Dear Ivan,

I have just run into quite the same issue. According to my search there
is no direct way to do this.

But have found a workaround. So my proposal for you is:

1. Within your JSR223Sampler, store the information you need into a
variable like

        vars.put("name of the variable", "the setUp Thread Group is completed\n");

2. In your JMeter SampleListener / sampleOccurred() method, you ca
access the value of the variable by

JMeterContextService.getContext().getVariables().get("name of the
variable");

Now you can send the information where ever you want.


I hope this helps you. It is cumbersome, but it works.

Best wishes,

Elke


Am 26.02.19 um 08:20 schrieb Ivan Rancati:

> hi Antonio,
>
> thanks, I'll try annotations for graphics.
> However, my question was slightly different: how to get some information
> displayed in real time during test execution. Apologies if it was unclear.
> For the current project, I have a simple, ssh-only infrastructure, without
> Grafana.
>
> Best regards,
> Ivan
>
> On Mon, Feb 25, 2019 at 3:34 PM Antonio Gomes Rodrigues <[hidden email]>
> wrote:
>
>> Hi,
>>
>> Have you try annotations like
>> http://docs.grafana.org/reference/annotations/
>> ?
>>
>> Antonio
>>
>> Le lun. 25 févr. 2019 à 15:00, Ivan Rancati <[hidden email]> a
>> écrit :
>>
>>> Hello,
>>>
>>> I have a couple of test plans (run in non-GUI mode), where I use a JSR223
>>> sampler (groovy) to display on the console when a certain stage is
>> reached.
>>> For example, to indicate the setUp thread/s is/are complete:
>>>
>>> OUT.println("the setUp Thread Group is completed\n")
>>>
>>> This works locally, but of course not with remote execution. Is there an
>>> equivalent way to display, on the controller's console, a similar message
>>> when a remote has finished a thread, or some other stage is reached?
>>>
>>> Thanks a lot and best regards,
>>> Ivan
>>>
--
Trilobyte Software Engineering GmbH
Schliemannstr. 45, 10437 Berlin
Geschäftsführer: Stefan Seide, Sven Gerhardt
Berlin, Amtsgericht Charlottenburg, HRB 103208

Reply | Threaded
Open this post in threaded view
|

Re: Groovy OUT.println() in remote execution

shettyd
In reply to this post by Ivan Rancati-3
Hi
Never tried but I would probably try to tweak the logging so that the
appender is one that can collate information from multiple clients and show
it wherever you prefer (Something like a socket appender in log4j with
simple socket server)

regards
deepak

On Mon, Feb 25, 2019 at 11:20 PM Ivan Rancati <[hidden email]>
wrote:

> hi Antonio,
>
> thanks, I'll try annotations for graphics.
> However, my question was slightly different: how to get some information
> displayed in real time during test execution. Apologies if it was unclear.
> For the current project, I have a simple, ssh-only infrastructure, without
> Grafana.
>
> Best regards,
> Ivan
>
> On Mon, Feb 25, 2019 at 3:34 PM Antonio Gomes Rodrigues <[hidden email]>
> wrote:
>
> > Hi,
> >
> > Have you try annotations like
> > http://docs.grafana.org/reference/annotations/
> > ?
> >
> > Antonio
> >
> > Le lun. 25 févr. 2019 à 15:00, Ivan Rancati <[hidden email]> a
> > écrit :
> >
> > > Hello,
> > >
> > > I have a couple of test plans (run in non-GUI mode), where I use a
> JSR223
> > > sampler (groovy) to display on the console when a certain stage is
> > reached.
> > > For example, to indicate the setUp thread/s is/are complete:
> > >
> > > OUT.println("the setUp Thread Group is completed\n")
> > >
> > > This works locally, but of course not with remote execution. Is there
> an
> > > equivalent way to display, on the controller's console, a similar
> message
> > > when a remote has finished a thread, or some other stage is reached?
> > >
> > > Thanks a lot and best regards,
> > > Ivan
> > >
> >
>