jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Substring
Date Tue, 06 Nov 2012 12:45:10 GMT
On 6 November 2012 12:00, Shmuel Krakower <shmulikk@gmail.com> wrote:
> Hi Sebb,
> Thats a good point. One of the good things about JMeter is that it doesnt
> bring a new scripting language and this makes it easier for other people to
> use, so each can implement its own stuff/libraries with his preferred
> language.
>
> On the other hand, as a jmeter user, i find some of the "built in"
> functions handy in many of my scripts.
>
> Where should be the limit between creating more handy jmeter functions to
> not creating too much of those?

It depends.

Various factors to consider:
- is the function generally useful, i.e. how many scripts are likely to need it?
- is there a work-round, e.g. pre-process the data?
- is the function is very difficult to code using scripting?
- is the function is too expensive when using scripting?

There are probably other factors I've omitted; some of the above are
not clear-cut either.

> בתאריך 2012 11 6 13:49, מאת "sebb" <sebbaz@gmail.com>:
>
>> On 6 November 2012 06:49, Philippe Mouawad <philippe.mouawad@gmail.com>
>> wrote:
>> > Use case is the following.
>> > A search screen with auto complete feature that triggers on first 3
>> letters
>> > then on next type.
>> >
>> > So I use a csv for words to search and I need substring to simulate
>> > typeahead/autocomplete calls.
>>
>> If I were doing that test I'd probably put the substring in the CSV
>> file - cheaper to do it before the test.
>>
>> > Note that I succeed doing it with beanshell preprocessor but I find it a
>> > bit too hard for just that and not great for performances.
>>
>> It's quite easy to set up BeanShell functions in a startup script
>> which should improve performance.
>>
>> I.e. define the property:
>>
>> beanshell.function.init=BeanShellFunction.bshrc
>>
>> and create the function:
>>
>> String substring(str,beg,end) {
>>   return s.substring(str,beg,end);
>> }
>>
>> I'm not saying we should not add more functions, but we need to be
>> careful not to add lots of special-purpose functions that are rarely
>> used but still require testing, maintaining and documenting. Also the
>> user has to read more documentation.
>>
>> > Regards
>> > Philippe
>> >
>> > On Tuesday, November 6, 2012, sebb wrote:
>> >
>> >> On 5 November 2012 20:08, Philippe Mouawad <philippe.mouawad@gmail.com
>> <javascript:;>>
>> >> wrote:
>> >> > Hello,
>> >> > I am working currently on a test where I need substring function.
>> >> > I see it seems to require either javascript or beanshell, wouldn't
it
>> be
>> >> > useful to have a jmeter function ?
>> >> >
>> >> > If you are ok, i will implement it and raise a bugzilla.
>> >>
>> >> Is your use case generally applicable?
>> >>
>> >> If so, then OK, otherwise it is just bloat.
>> >>
>> >> > Regards
>> >> > Philippe
>> >> >
>> >> >
>> >> > --
>> >> > Cordialement.
>> >> > Philippe Mouawad.
>> >>
>> >
>> >
>> > --
>> > Cordialement.
>> > Philippe Mouawad.
>>

Mime
View raw message