You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Philippe Mouawad <ph...@gmail.com> on 2016/01/20 21:41:48 UTC

Re: Create Macro Feature was Post-Sampler Timers

Hi Vladimir,
Did you by any chance start the work on this feature ?
Thanks
Regards

On Mon, May 18, 2015 at 9:51 PM, Vladimir Sitnikov <
sitnikov.vladimir@gmail.com> wrote:

> Let's move "csv" discussion to a separate thread and keep "macro
> feature" thread till a good case for it appears?
>
> I think a mock-up with "parameters and possible values" for the "CSV
> dataset" would be a good next step.
>
> Vladimir
>



-- 
Cordialement.
Philippe Mouawad.

Re: Create Macro Feature was Post-Sampler Timers

Posted by Vladimir Sitnikov <si...@gmail.com>.
>And how about Eclipse support ?

JFYI: MPS provides an ability to create a standalone IDE (for
instance, that could be an IDE that edits JMeter DSL only) or "a
plugin to Jetbrains platform" (e.g. plugin for IDEA).

>From Eclipse perspective there's https://eclipse.org/Xtext/

The key difference is Xtext is a text language framework, while MPS is
a projectional editor.
In Xtext you write a text script (with autocomplete, error highlight
from IDE), however you can easily type invalid text fragment and it
would just become all red.
In Xtext you can mess with code formatting as you wish (it's just a
text) unless language designer made a strong rules on that (e.g.
python-like rules where whitespace is important)

In MPS you have to fill in the gaps. There is no "text", however MPS
team worked very hard so the editor does feel like a text editor.
Since MPS is always a set of "components with gaps", there is no way
to reformat code. The code is always in the form that was designed by
"language designer".
For instance, "2+3*4" in MPS is PlusExpression(2,
MultiplyExpression(3,4)), so you never have to work with
"invalid/incomplete code" while implementing refactoring code.

PS. Consider me biased here. I've no interest in Eclipse/Xtext yet. I
do not work for JetBrains.

Vladimir

Re: Create Macro Feature was Post-Sampler Timers

Posted by Philippe Mouawad <ph...@gmail.com>.
And how about Eclipse support ?
Can we have auto completion ? or code highlighting ?

All your arguments look convincing , I suggest ypu raise the subject on dev
list if you feel like contributing after that ?
I'll be happy to help a bit.

Regards


On Wednesday, January 20, 2016, Vladimir Sitnikov <
sitnikov.vladimir@gmail.com> wrote:

> >I'm afraid it would take you a long while to do that in "groovy"
>
> Just to be realistic:  MPS does not provide a debugger for JMeter
> scripts "for free".
> However, MPS provides reasonable APIs, so one can plug its own notion
> of breakpoint/watch variable/evaluate expression.
>
> Mbeddr team managed to integrate that with gdb, so they debug C code.
> The base language for MPS is java, so integrating java would be a lot
> easier.
>
> groovy/or whatever programming DSL might be suitable for powerful
> users (the ones who know what they are doing).
> MPS might be good for non-programmers as it does not provide user a
> way to type free-text.
> All that you type is accepted only if the particular element was designed.
>
> E.g. my prototype defined "http sampler", thus when I type "http
> sampler", MPS recognizes it because "http sampler" is valid in given
> context.
> For instance, it does not recognize "http sampler" under "http
> sampler". Nor it lists that in the autocomplete menu.
>
> I expect that should be easier for newbies than "free text programming".
>
> Vladimir
>


-- 
Cordialement.
Philippe Mouawad.

Re: Create Macro Feature was Post-Sampler Timers

Posted by Vladimir Sitnikov <si...@gmail.com>.
>I'm afraid it would take you a long while to do that in "groovy"

Just to be realistic:  MPS does not provide a debugger for JMeter
scripts "for free".
However, MPS provides reasonable APIs, so one can plug its own notion
of breakpoint/watch variable/evaluate expression.

Mbeddr team managed to integrate that with gdb, so they debug C code.
The base language for MPS is java, so integrating java would be a lot easier.

groovy/or whatever programming DSL might be suitable for powerful
users (the ones who know what they are doing).
MPS might be good for non-programmers as it does not provide user a
way to type free-text.
All that you type is accepted only if the particular element was designed.

E.g. my prototype defined "http sampler", thus when I type "http
sampler", MPS recognizes it because "http sampler" is valid in given
context.
For instance, it does not recognize "http sampler" under "http
sampler". Nor it lists that in the autocomplete menu.

I expect that should be easier for newbies than "free text programming".

Vladimir

Re: Create Macro Feature was Post-Sampler Timers

Posted by Vladimir Sitnikov <si...@gmail.com>.
> one more note, how does groovy within jsr223 sampler would render in this
solution (or any other language ) ?

That is a very good question.
The dumb way is to add a swing component like "rich text area" (MPS
easily allows to integrate swing components), however autocomplete
within groovy would be missing.

In ${...} I reused "MPS'es base language", so it gave me "java-like
expression for free" (e.g. strings, numbers, "adsfadf".hashCode(),
etc).

The better way might be to express some reasonable subset in a MPS
defined way, so it can autocomplete/typecheck/etc.

Vladimir

Re: Create Macro Feature was Post-Sampler Timers

Posted by Philippe Mouawad <ph...@gmail.com>.
one more note, how does groovy within jsr223 sampler would render in this
solution (or any other language ) ?

On Wednesday, January 20, 2016, Vladimir Sitnikov <
sitnikov.vladimir@gmail.com> wrote:

> > but Groovy IDE support is quite good.
>
> Write-only DSL is easy in any language.
> Implementing proper semantics is hard.
>
> Implementing language-aware autocomplete/validations is much harder
> than just implementing a DSL that would produce jmx files.
>
> By language aware I mean JMeter-aware.
>
> For instance: how would you teach IDE to highlight "http sampler
> cannot be placed under thread group" error if that is groovy DSL?
>
> Another example: one of the "samplers" declares a variable, then you
> need to be able to "use" that variable.
> You need to be able to navigate to the sampler "which defined that
> variable".
> You need to be able to find all the usages of "given regular
> expression extractor".
>
> I'm not talking about groovy variables here.
> Think of "regexp extractor". It can easily produce lots of JMeter
> variables behind the scenes (match0, match1, ...). Groovy code would
> not mention that, would it?
>
> How IDE would know that "match0" variable is valid and "abc" is not?
>
> language-aware refactorings are even harder.
> It is not that easy to teach groovy DSL that "transaction controller"
> can be exchanged with "simple controller".
>
> Another point: groovy is a text language.
> 0) This is a no-go for non-programmers. From my experience, there are
> lots of JMeter enginers who are not fluent in programming.
> 1) How would you implement a table in groovy DSL? Just a table with
> parameters and checkboxes.
> 2) Http sampler could be very rich in terms of configuration. The text
> format would be rather bloated, so being able to hide non-relevant
> notes is a plus for a non-text representation.
>
> Vladimir
>


-- 
Cordialement.
Philippe Mouawad.

Re: Create Macro Feature was Post-Sampler Timers

Posted by Vladimir Sitnikov <si...@gmail.com>.
> but Groovy IDE support is quite good.

Write-only DSL is easy in any language.
Implementing proper semantics is hard.

Implementing language-aware autocomplete/validations is much harder
than just implementing a DSL that would produce jmx files.

By language aware I mean JMeter-aware.

For instance: how would you teach IDE to highlight "http sampler
cannot be placed under thread group" error if that is groovy DSL?

Another example: one of the "samplers" declares a variable, then you
need to be able to "use" that variable.
You need to be able to navigate to the sampler "which defined that variable".
You need to be able to find all the usages of "given regular
expression extractor".

I'm not talking about groovy variables here.
Think of "regexp extractor". It can easily produce lots of JMeter
variables behind the scenes (match0, match1, ...). Groovy code would
not mention that, would it?

How IDE would know that "match0" variable is valid and "abc" is not?

language-aware refactorings are even harder.
It is not that easy to teach groovy DSL that "transaction controller"
can be exchanged with "simple controller".

Another point: groovy is a text language.
0) This is a no-go for non-programmers. From my experience, there are
lots of JMeter enginers who are not fluent in programming.
1) How would you implement a table in groovy DSL? Just a table with
parameters and checkboxes.
2) Http sampler could be very rich in terms of configuration. The text
format would be rather bloated, so being able to hide non-relevant
notes is a plus for a non-text representation.

Vladimir

Re: Create Macro Feature was Post-Sampler Timers

Posted by Pascal Schumacher <pa...@gmx.net>.
Am 20.01.2016 um 22:43 schrieb Vladimir Sitnikov:
>> Is MPs easier than groovy way ?
> "groovy way" does not provide "IDE integration".
>
> MPS gives lots of IDE stuff "for free":
> 1) error highlight, intentions
> 2) autocomplete (I can type "http sampler" or just "sampler" and press
> ctrl+space)
> 3) "find usages", "rename", refactorings (e.g. "extract fragment" or whatever)
>
> On top of that, MPS can be used to integrate debugger.
> That means, you can launch the script from within MPS, add a
> breakpoint, watch variables, etc, etc.
> I'm afraid it would take you a long while to do that in "groovy".
I have never worked with MPS, but Groovy IDE support is quite good.

There is also 
http://blog.andresteingress.com/2013/01/25/groovy-2-1-the-delegatesto-annotation/ 
to enable better IDE support for Groovy DSLs.

Just saying.

Re: Create Macro Feature was Post-Sampler Timers

Posted by Vladimir Sitnikov <si...@gmail.com>.
>Is Jetbrains MPS a viable approach in terms of popularity of the product
>and maintainabilty ?

Well, the community is not that big.
For instance, there is http://mbeddr.com/ that is updated rather frequently.

>I suppose your work is on github ?

Not yet.

>Is MPs easier than groovy way ?

"groovy way" does not provide "IDE integration".

MPS gives lots of IDE stuff "for free":
1) error highlight, intentions
2) autocomplete (I can type "http sampler" or just "sampler" and press
ctrl+space)
3) "find usages", "rename", refactorings (e.g. "extract fragment" or whatever)

On top of that, MPS can be used to integrate debugger.
That means, you can launch the script from within MPS, add a
breakpoint, watch variables, etc, etc.
I'm afraid it would take you a long while to do that in "groovy".


Vladimir

Re: Create Macro Feature was Post-Sampler Timers

Posted by Philippe Mouawad <ph...@gmail.com>.
On Wednesday, January 20, 2016, Vladimir Sitnikov <
sitnikov.vladimir@gmail.com> wrote:

> Hi, I'm afraid I was not.
>
> "dummy loop at the very start of the test" was good enough to skip items.
>
> I did play a bit with JetBrains MPS and I created a prototype of a DSL
> for JMeter though: http://recordit.co/0ngw6RSkm9
> What do you think of that?

Very interesting.
Is Jetbrains MPS a viable approach in terms of popularity of the product
and maintainabilty ?


 I have in mind to create a JMeter Dsl more inspired from ruby-jmeter which
I find nice to read.
But I don't have time to work on it.
Is MPs easier than groovy way ?

I had looked at groovy ways to make a dsl but it was just an idea.
I suppose your work is on github ?


> I mean even if JMeter core does not support "skip CSV records", a DSL
> can "easily" workaround that (e.g. by appending dummy loop at the
> start).


ok.

But it would be great to have you in the team implementing things that live
in core .
I always read that you created nice features and would be very happy if you
contributed them to core :)

>
> Vladimir
>


-- 
Cordialement.
Philippe Mouawad.

Re: Create Macro Feature was Post-Sampler Timers

Posted by Vladimir Sitnikov <si...@gmail.com>.
Hi, I'm afraid I was not.

"dummy loop at the very start of the test" was good enough to skip items.

I did play a bit with JetBrains MPS and I created a prototype of a DSL
for JMeter though: http://recordit.co/0ngw6RSkm9
What do you think of that?

I mean even if JMeter core does not support "skip CSV records", a DSL
can "easily" workaround that (e.g. by appending dummy loop at the
start).

Vladimir