Development of a Jmeter's plugin

3,426 views
Skip to first unread message

Agustín Sabater Piñeiro

unread,
Feb 19, 2011, 1:22:43 PM2/19/11
to jmeter-plugins
Hello, my name is Agustín, nice to meet you.

My final degree project is to develop a simple plugin for JMeter, this
is a problem because i dont know very well how I can start the plugin.
So if you can give me any bog post, or website, so I can start
developing i would be very thankful to you.

I really need it, because if I dont give some results in a week i
would be rejected from the college. :(

APC

unread,
Feb 20, 2011, 4:14:39 AM2/20/11
to jmeter-plugins
Agustín,

Extending JMeter is very easy. First thing you need is to choose
plugin type you write. There is listeners, samplers, timers, thread
groups, configs, pre- and post-processors, assertions and controllers.

Which one do you choose? Have you an idea what will be enough for your
degree project?

I don't know articles on extending JMeter except this tutorial:
http://jakarta.apache.org/jmeter/extending/jmeter_tutorial.pdf

When I was starting this project I found that tutorial useless and
just got JMeter's code and looked how they implement out-of-the-box
plugins.

Also you need to know Java programming language and some IDE where
you'll write your code.

One week is enough to write plugin. Hold on, pal!

Agustín Sabater Piñeiro

unread,
Feb 23, 2011, 5:46:18 AM2/23/11
to jmeter-plugins
Thanks for your answer, I will try to answer all the questions.

Extending JMeter is very easy. First thing you need is to choose
plugin type you write. There is listeners, samplers, timers, thread
groups, configs, pre- and post-processors, assertions and
controllers.

At this moment is not very clear what kind of plugin is needed. I
think my tutor want a multiplugin. Needs a parser, a downloader, a
auto login system, a comparer between different source code...

Well, calm. First of all i simply wanna create a dummy plugin name "My
final degree plugin". With that the tutor will tellme the next step.

Can I make that modifying the Dummy sampler?

Plz note I'm rusty with Java, I remember some thinks, but I will have
to re-learn anothers. =\

APC

unread,
Feb 23, 2011, 3:24:31 PM2/23/11
to jmeter-plugins
Yes, you can get Dummy Sampler as example and add it some
functionality... But I can't imagine what kind of functionality you
can add.

By the way, you can add Request data field to it and share code with
us, it will be useful. The task is:
1. Add GUI field similar to Response Data, name it "Request Data", put
it above Response Data
2. Modify DummySampler class - add new property name constant, add
getter and setter methods for that property. Add call to
res.setSamplerData in sample() method, it is totally similar to
setResponseData.
3. Modify DummySamplerGui code to save new field to sampler property,
just like it is done with ResponseData

The work is pretty simple.

Or you could write a UDP sampler... This is more complex, and far more
useful.

Or, or, or... What is real to make in your situation?

Agustín Sabater Piñeiro

unread,
Mar 4, 2011, 10:22:56 AM3/4/11
to jmeter-plugins
Hi, sorry for the lack of answers but i have many ongoing projects, so
I can't work on the plugin as much as I want. The goal to develop the
first version of the plugin were simply a request of my tutor. The
real work start now, the first thing I have to do is to develop a
plugin, no need to use Dummy Sampler anymore, that can download a list
of webpages (source code). I think the best way to start developing
it, is to develop a simply version that can only download one webpage,
and after that develop a multiple downloader.

There is any plugin wich I could modify with few effort?

Thanks for all :)

APC

unread,
Mar 4, 2011, 10:39:51 AM3/4/11
to jmeter-plugins
Yes, it is HTTP Raw Request from trunk. Or still Dummy Sampler, it's
most simple plugin to extend

Agustín Sabater Piñeiro

unread,
Mar 8, 2011, 10:33:07 AM3/8/11
to jmeter-plugins
Is HTTP Raw Request plugin is equal to RawRequestSourcePreProcessor ?

APC

unread,
Mar 8, 2011, 10:50:10 AM3/8/11
to jmeter-plugins
No, Raw Data Source used to load data from file into JMeter Variable,
and Raw Request can use that data from Variable to send to server.

Agustín Sabater Piñeiro

unread,
Mar 13, 2011, 5:24:02 AM3/13/11
to jmeter-plugins
HTTPRawSampler ?

APC

unread,
Mar 13, 2011, 6:48:26 AM3/13/11
to jmeter-plugins
HTTPRawSampler what?

Agustín Sabater Piñeiro

unread,
Mar 13, 2011, 7:25:05 AM3/13/11
to jmeter-plugins
Sorry, I don't find the 'HTTP Raw Request' plugin in the SVN, so I'm
trying to guess what was the plugin you were talking.

That plugin is a sampler plugin? Can I extend HTTPRawSampler?

APC

unread,
Mar 13, 2011, 10:01:51 AM3/13/11
to jmeter-plugins
Of course, you can extend HTTPRawSampler. Don't forget appropriate Gui
class.

Agustín Sabater Piñeiro

unread,
Mar 15, 2011, 5:32:58 AM3/15/11
to jmeter-plugins
Hi again, I've compiled HTTPRawSampler to prepare the road everything
seemed to be OK, but now right button on JMeter window doesn't
anything.

This image [ http://k02.kn3.net/F1796AFD6.pngv ] will show you wich
structure I have.

What's the problem? Someone can help me ?

APC

unread,
Mar 15, 2011, 5:38:31 AM3/15/11
to jmeter-plugins
Did you compile your code into JAR file? Placed that JAR into lib/ext?

Agustín Sabater Piñeiro

unread,
Mar 15, 2011, 5:43:54 AM3/15/11
to jmeter-plugins
Sure, see:

package:
[jar] Building jar: /Users/agustinsabaterpineiro/Documents/
workspace/jakarta-jmeter-2.4/lib/ext/ApacheJMeter_addons.jar

APC

unread,
Mar 15, 2011, 6:10:52 AM3/15/11
to jmeter-plugins
Do you have any errors in JMEter.log file?

Did you tried adding Thread Group to your test plan, then add Sampler
as child to Thread Group?

Agustín Sabater Piñeiro

unread,
Mar 15, 2011, 6:22:29 AM3/15/11
to jmeter-plugins
I think theres no errors. Here I paste the output:

$ ant -buildfile 'addons.xml'
Buildfile: /Users/agustinsabaterpineiro/Documents/workspace/jakarta-
jmeter-2.4/addons.xml

compile:
[javac] Compiling 4 source files to /Users/agustinsabaterpineiro/
Documents/workspace/jakarta-jmeter-2.4/build/addons
[javac] Note: /Users/agustinsabaterpineiro/Documents/workspace/
jakarta-jmeter-2.4/addons/JMeterPluginsUtils.java uses unchecked or
unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.

package:
[jar] Building jar: /Users/agustinsabaterpineiro/Documents/
workspace/jakarta-jmeter-2.4/lib/ext/ApacheJMeter_addons.jar

BUILD SUCCESSFUL
Total time: 1 second

APC

unread,
Mar 15, 2011, 6:36:54 AM3/15/11
to jmeter-plugins
I mean jmeter.log file...

Agustín Sabater Piñeiro

unread,
Mar 15, 2011, 7:21:58 AM3/15/11
to jmeter-plugins
Ahm sorry :-$

The content of the file jmeter.log is:

2011/03/15 10:22:23 INFO - jmeter.util.JMeterUtils: Setting Locale to
es_ES
2011/03/15 10:22:24 WARN - jmeter.util.JMeterUtils: Could not find
resources for 'es_ES', using 'es'
2011/03/15 10:22:24 INFO - jmeter.JMeter: Loading user properties
from: /Users/agustinsabaterpineiro/Documents/workspace/jakarta-
jmeter-2.4/bin/user.properties
2011/03/15 10:22:24 INFO - jmeter.JMeter: Loading system properties
from: /Users/agustinsabaterpineiro/Documents/workspace/jakarta-
jmeter-2.4/bin/system.properties
2011/03/15 10:22:24 INFO - jmeter.JMeter: Copyright (c) 1998-2010 The
Apache Software Foundation
2011/03/15 10:22:24 INFO - jmeter.JMeter: Version 2.4 r961953
2011/03/15 10:22:24 INFO - jmeter.JMeter: java.version=1.6.0_24
2011/03/15 10:22:24 INFO - jmeter.JMeter: java.vm.name=Java
HotSpot(TM) 64-Bit Server VM
2011/03/15 10:22:24 INFO - jmeter.JMeter: os.name=Mac OS X
2011/03/15 10:22:24 INFO - jmeter.JMeter: os.arch=x86_64
2011/03/15 10:22:24 INFO - jmeter.JMeter: os.version=10.6.6
2011/03/15 10:22:24 INFO - jmeter.JMeter: file.encoding=MacRoman
2011/03/15 10:22:24 INFO - jmeter.JMeter: Default Locale=espa–ol
(Espa–a)
2011/03/15 10:22:24 INFO - jmeter.JMeter: JMeter Locale=espa–ol
(Espa–a)
2011/03/15 10:22:24 INFO - jmeter.JMeter: JMeterHome=/Users/
agustinsabaterpineiro/Documents/workspace/jakarta-jmeter-2.4
2011/03/15 10:22:24 INFO - jmeter.JMeter: user.dir =/Users/
agustinsabaterpineiro/Documents/workspace/jakarta-jmeter-2.4/bin
2011/03/15 10:22:24 INFO - jmeter.JMeter: PWD =/Users/
agustinsabaterpineiro/Documents/workspace/jakarta-jmeter-2.4/bin
2011/03/15 10:22:24 INFO - jmeter.JMeter: IP: 192.168.1.101 Name:
Macintosh-3.local FullName: 192.168.1.101
2011/03/15 10:22:24 INFO - jmeter.JMeter: Loaded icon properties from
org/apache/jmeter/images/icon.properties
2011/03/15 10:22:25 INFO - jmeter.engine.util.CompoundVariable: Note:
Function class names must contain the string: '.functions.'
2011/03/15 10:22:25 INFO - jmeter.engine.util.CompoundVariable: Note:
Function class names must not contain the string: '.gui.'
2011/03/15 10:22:26 WARN - jmeter.gui.util.MenuFactory: Could not
instantiate kg.apc.jmeter.samplers.HTTPRawAgustinSamplerGui
java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(ImageIcon.java:167)
at
kg.apc.jmeter.JMeterPluginsUtils.addHelpLinkToPanel(JMeterPluginsUtils.java:
145)
at
kg.apc.jmeter.samplers.HTTPRawAgustinSamplerGui.init(HTTPRawAgustinSamplerGui.java:
110)
at
kg.apc.jmeter.samplers.HTTPRawAgustinSamplerGui.<init>(HTTPRawAgustinSamplerGui.java:
40)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at
org.apache.jmeter.gui.util.MenuFactory.initializeMenus(MenuFactory.java:
439)
at org.apache.jmeter.gui.util.MenuFactory.<clinit>(MenuFactory.java:
154)
at
org.apache.jmeter.control.gui.WorkBenchGui.createPopupMenu(WorkBenchGui.java:
86)
at
org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:
114)
at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:
44)
at
org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:
82)
at org.apache.jmeter.gui.action.ActionRouter.access
$000(ActionRouter.java:42)
at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:
61)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:678)
at java.awt.EventQueue.access$000(EventQueue.java:86)
at java.awt.EventQueue$1.run(EventQueue.java:639)
at java.awt.EventQueue$1.run(EventQueue.java:637)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext
$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:648)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:
296)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:
211)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

2011/03/15 10:22:26 ERROR - jmeter.gui.util.MenuFactory:
java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(ImageIcon.java:167)
at
kg.apc.jmeter.JMeterPluginsUtils.addHelpLinkToPanel(JMeterPluginsUtils.java:
145)
at
kg.apc.jmeter.samplers.HTTPRawAgustinSamplerGui.init(HTTPRawAgustinSamplerGui.java:
110)
at
kg.apc.jmeter.samplers.HTTPRawAgustinSamplerGui.<init>(HTTPRawAgustinSamplerGui.java:
40)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at
org.apache.jmeter.gui.util.MenuFactory.initializeMenus(MenuFactory.java:
439)
at org.apache.jmeter.gui.util.MenuFactory.<clinit>(MenuFactory.java:
154)
at
org.apache.jmeter.control.gui.WorkBenchGui.createPopupMenu(WorkBenchGui.java:
86)
at
org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:
114)
at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:
44)
at
org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:
82)
at org.apache.jmeter.gui.action.ActionRouter.access
$000(ActionRouter.java:42)
at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:
61)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:678)
at java.awt.EventQueue.access$000(EventQueue.java:86)
at java.awt.EventQueue$1.run(EventQueue.java:639)
at java.awt.EventQueue$1.run(EventQueue.java:637)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext
$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:648)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:
296)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:
211)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

APC

unread,
Mar 15, 2011, 7:54:22 AM3/15/11
to jmeter-plugins
Well, here's your exception, try fixing it. Just remove the code that
adds help link to panel.
> ...
>
> продолжение »

Agustín Sabater Piñeiro

unread,
Mar 15, 2011, 11:08:53 AM3/15/11
to jmeter-plugins
It works!

Soon I'll post more news :)

Thanks 4 all
> ...
>
> leer más »

Agustín Sabater Piñeiro

unread,
Mar 17, 2011, 12:12:42 PM3/17/11
to jmeter-plugins
Hi, the plugin is working very well, but what I need is to save an
HTML file with the page's source code.

How can I get this?


Thanks

On 15 mar, 12:54, APC <a...@apc.kg> wrote:
> ...
>
> leer más »

APC

unread,
Mar 17, 2011, 12:18:03 PM3/17/11
to jmeter-plugins
Samplers not intended to save anything to disk. They make requests and
provide samples.
Writing to file is Listeners function. Extend AbstractListenerGui and
you can save anything from SampleResults...
> ...
>
> продолжение »

Agustín Sabater Piñeiro

unread,
Mar 18, 2011, 6:23:45 AM3/18/11
to jmeter-plugins
Are there any plugin wich extends AbstractListenerGui?

Thx
> ...
>
> leer más »

APC

unread,
Mar 18, 2011, 6:43:18 AM3/18/11
to jmeter-plugins
All our graphs extend that class
> ...
>
> продолжение »

Agustín Sabater Piñeiro

unread,
Mar 18, 2011, 7:46:29 AM3/18/11
to jmeter-plugins
I don't know if FlexibleFileWriter is a good plugin to extend, but I
see it extends AbstractListenerGui and saves data into a text file,
now I need to access the html source code and save it into a file, how
can I read the source code data?
> ...
>
> leer más »

APC

unread,
Mar 18, 2011, 8:20:44 AM3/18/11
to jmeter-plugins
response data available with res.getResponseDataAsString() in add()
method
> ...
>
> продолжение »

Agustín Sabater Piñeiro

unread,
Mar 19, 2011, 2:18:04 PM3/19/11
to jmeter-plugins
Ok, more questions.

Can I use FlexibleFileWriterGui.java ? It extends AbstractListenerGui,
and with that name it seems very appropriate to insert it here.

Assuming that the answer is "Yeah, this is OK", wich is the method
add? appendSampleResultField?

Please, be patient with me, I have more will than knowledge ^^U

Thanks for all

On 18 mar, 11:43, APC <a...@apc.kg> wrote:
> ...
>
> leer más »

APC

unread,
Mar 19, 2011, 2:35:46 PM3/19/11
to jmeter-plugins
FlexibleFileWriter will confuse you because it uses custom underlying
TestElement. I'd not suggest you using it.
You better take something like Jmeter's native Graph Results plugin
and start with it.
Copy its source and override getStaticLabel method. Then customize
"add()" method contentds to your needs
> ...
>
> продолжение »

Agustín Sabater Piñeiro

unread,
Mar 21, 2011, 12:39:35 PM3/21/11
to jmeter-plugins
I don't find the Graph Results source code. Can you tellme the path
into the source where it is? Or if it's not in the source of jakarta
jmeter, please tellme an url where I can finde it.

Thanks
> ...
>
> leer más »

APC

unread,
Mar 21, 2011, 12:51:11 PM3/21/11
to jmeter-plugins
Repository path is:
http://svn.apache.org/repos/asf/jakarta/jmeter/tags/v2_4/src/components/org/apache/jmeter/visualizers/GraphVisualizer.java

On 18 мар, 13:43, APC <a...@apc.kg> wrote:
> ...
>
> продолжение »

Agustín Sabater Piñeiro

unread,
Mar 25, 2011, 4:28:15 AM3/25/11
to jmeter-plugins
Ok, I have modified the add() method at GraphVisualizer.java so it can
save into a text file the source code of the page.

Now I will need to save more than just one webpage's sourcecode, I can
do that adding more than one HTTP request, but I don't know how to
access the web page's name to name the source code (like google.html,
whatever.html, facebook.html). It is possible to do?

Thanks 4 all, you are the best!

On 21 mar, 17:51, APC <a...@apc.kg> wrote:
> Repository path is:http://svn.apache.org/repos/asf/jakarta/jmeter/tags/v2_4/src/componen...
> ...
>
> leer más »

APC

unread,
Mar 25, 2011, 4:49:33 AM3/25/11
to jmeter-plugins
SampleResult has its SamplerData and other fields.
Investigate SampleResult's source code and see what more can help you.
And make experiments!
> ...
>
> продолжение »

Agustín Sabater Piñeiro

unread,
Mar 25, 2011, 8:25:35 AM3/25/11
to jmeter-plugins
Thanks, now the plugin saves the source code of all pages previously
requested.

After the next meeting with my tutor I will tell more :)
> ...
>
> leer más »

Agustín Sabater Piñeiro

unread,
Mar 30, 2011, 11:15:40 AM3/30/11
to jmeter-plugins
The meeting were fantastic, the tutor is really happy with the work.

I have to modify the plugin to let the user specify the folder where
the HTML files must be saved. I though to modify the results file
chooser to let me do that, Is that possible?
> ...
>
> leer más »

Andrey Pohilko

unread,
Mar 30, 2011, 11:53:04 AM3/30/11
to jmeter-plugins
Sorry here, I don't know anything about file chooser internals...
For me simple text input field is good enough to specify file.
File choosers optional.
> ...
>
> продолжение »

Agustín Sabater Piñeiro

unread,
Apr 2, 2011, 1:08:58 PM4/2/11
to jmeter-plugins
In wich method can I insert a text input field?
> ...
>
> leer más »

Andrey Pohilko

unread,
Apr 2, 2011, 3:57:28 PM4/2/11
to jmeter-plugins
In init() method of gui class
> ...
>
> продолжение »

Agustín Sabater Piñeiro

unread,
Apr 18, 2011, 7:57:25 AM4/18/11
to jmeter-plugins
Hi again, sorry for the lack of news.

I have to modify the log box, http://goo.gl/aTpj7 but I cant modify
the jmeter code, so I must remove this box and add my own box for
select box.

Its possible to do? My english is very poor, so if you dont
understand anything I can rewrite the text if You want.

Andrey Pohilko

unread,
Apr 18, 2011, 8:24:27 AM4/18/11
to jmeter-plugins
I suggest you don't touch or rewrite that box, you'll lose a lot of
time.
Just add another GUI component inside your plugin, the way other
components added.

On 18 апр, 15:57, Agustín Sabater Piñeiro <pinye...@gmail.com> wrote:
> Hi again, sorry for the lack of news.
>
> I have to modify the log box,http://goo.gl/aTpj7but I cant modify

Agustín Sabater Piñeiro

unread,
Apr 18, 2011, 8:46:39 AM4/18/11
to jmeter-plugins
I think the same way. But I need to hide the tox, Is it possible to
do?

On 18 abr, 14:24, Andrey Pohilko <a...@apc.kg> wrote:
> I suggest you don't touch or rewrite that box, you'll lose a lot of
> time.
> Just add another GUI component inside your plugin, the way other
> components added.
>
> On 18 апр, 15:57, Agustín Sabater Piñeiro <pinye...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi again, sorry for the lack of news.
>
> > I have to modify the log box,http://goo.gl/aTpj7butI cant modify

Andrey Pohilko

unread,
Apr 18, 2011, 9:14:29 AM4/18/11
to jmeter-plugins
It is possible, but not the way I'd suggest you.

My advice to you - let this panel be, it's too unpredictable to remove
it.

On 18 апр, 16:46, Agustín Sabater Piñeiro <pinye...@gmail.com> wrote:
> I think the same way. But I need to hide the tox, Is it possible to
> do?
>
> On 18 abr, 14:24, Andrey Pohilko <a...@apc.kg> wrote:
>
>
>
>
>
>
>
> > I suggest you don't touch or rewrite that box, you'll lose a lot of
> > time.
> > Just add another GUI component inside your plugin, the way other
> > components added.
>
> > On 18 апр, 15:57, Agustín Sabater Piñeiro <pinye...@gmail.com> wrote:
>
> > > Hi again, sorry for the lack of news.
>
> > > I have to modify the log box,http://goo.gl/aTpj7butIcant modify

Agustín Sabater Piñeiro

unread,
Apr 18, 2011, 11:07:32 AM4/18/11
to jmeter-plugins
Well, it's really a problem for me. It's my final degree project and
it will be showed to a Court of teachers and they willl crush me with
questions like: What is the purpose of this box? Why did you let
here?

Theres other type of plugin I can use for downloading the web source
code?

Andrey Pohilko

unread,
Apr 18, 2011, 11:44:04 AM4/18/11
to jmeter-plugins
So answer your Court that this is basic JMeter listener panel,
allowing saving results and simple filter on error/success statuses.

And make your plugin main content impressive, for they to look at it
and not at top panel.

Agustín Sabater Piñeiro

unread,
Apr 18, 2011, 11:46:05 AM4/18/11
to jmeter-plugins
I will do it, thanks.

Agustín Sabater Piñeiro

unread,
Apr 20, 2011, 4:29:32 AM4/20/11
to jmeter-plugins
Hi again

Could you tell me an example of GUI component added to a plugin?

Thanks a lot

Andrey Pohilko

unread,
Apr 20, 2011, 5:34:12 AM4/20/11
to jmeter-plugins
See initGui() method in AbstractGraphPanelVisualizer

Agustín Sabater Piñeiro

unread,
Apr 20, 2011, 5:35:23 AM4/20/11
to jmeter-plugins
Thanks a lot

Agustín Sabater Piñeiro

unread,
May 10, 2011, 10:19:29 AM5/10/11
to jmeter-...@googlegroups.com
Hi again. 

I have a problem: The plugin doesn't saves any source code and I don't why. Jmeter.log have this information:

2011/05/10 16:10:19 ERROR - jmeter.threads.ListenerNotifier: Detected problem in Listener:  java.lang.NullPointerException
at org.apache.jmeter.visualizers.GraphVisualizer.updateGui(GraphVisualizer.java:140)
at org.apache.jmeter.visualizers.GraphVisualizer.add(GraphVisualizer.java:151)
at org.apache.jmeter.reporters.ResultCollector.sendToVisualizer(ResultCollector.java:497)
at org.apache.jmeter.reporters.ResultCollector.sampleOccurred(ResultCollector.java:473)
at org.apache.jmeter.threads.ListenerNotifier.notifyListeners(ListenerNotifier.java:87)
at org.apache.jmeter.threads.JMeterThread.notifyListeners(JMeterThread.java:694)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:362)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:243)
at java.lang.Thread.run(Thread.java:680)

The log points to this lines:

at org.apache.jmeter.visualizers.GraphVisualizer.updateGui(GraphVisualizer.java:140)

And here is the code: 

    public synchronized void updateGui(Sample s) {

        // We have received one more sample

        graph.updateGui(s);

        noSamplesField.setText(Long.toString(s.getCount()));  // Line 140

        dataField.setText(Long.toString(s.getData()));

        averageField.setText(Long.toString(s.getAverage()));

        deviationField.setText(Long.toString(s.getDeviation()));

        throughputField.setText(nf.format(60 * s.getThroughput()) + "/" + minute); // $NON-NLS-1$

        medianField.setText(Long.toString(s.getMedian()));

        updateYAxis();

    }


Also at org.apache.jmeter.visualizers.GraphVisualizer.add(GraphVisualizer.java:151)


//working

    public void add(SampleResult res) {

        updateGui(model.addSample(res)); //Line 151

    String filename;

    Calendar cal = Calendar.getInstance();  

        try {

        filename = res.getUrlAsString() + cal.getTime() + ".html";

        filename = filename.replace("http://", "");

        filename = filename.replace('/', '-');

        

        File file = new File(folderDestination + "/" + filename);

        FileWriter writer = new FileWriter(file);


        writer.write(res.getResponseDataAsString());

        writer.close();

        } catch (IOException ex) {

        ex.printStackTrace();

        }


    }


Could you give me any idea about what should be happening ?



Andrey Pohilko

unread,
May 11, 2011, 3:30:24 AM5/11/11
to jmeter-plugins
Well, it points you to line of code where you gen null value instead
of object. Maybe you should just check null value...

On May 10, 6:19 pm, Agustín Sabater Piñeiro <pinye...@gmail.com>
wrote:
> Hi again.
>
> I have a problem: The plugin doesn't saves any source code and I don't why.
> Jmeter.log have this information:
>
> *2011/05/10 16:10:19 ERROR - jmeter.threads.ListenerNotifier: Detected
> problem in Listener:  java.lang.NullPointerException*
> * at
> org.apache.jmeter.visualizers.GraphVisualizer.updateGui(GraphVisualizer.jav a:140)
> *
> * at
> org.apache.jmeter.visualizers.GraphVisualizer.add(GraphVisualizer.java:151) *
> * at
> org.apache.jmeter.reporters.ResultCollector.sendToVisualizer(ResultCollecto r.java:497)
> *
> * at
> org.apache.jmeter.reporters.ResultCollector.sampleOccurred(ResultCollector. java:473)
> *
> * at
> org.apache.jmeter.threads.ListenerNotifier.notifyListeners(ListenerNotifier .java:87)
> *
> * at
> org.apache.jmeter.threads.JMeterThread.notifyListeners(JMeterThread.java:69 4)
> *
> * at
> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:36 2)
> *
> * at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:243)*
> * at java.lang.Thread.run(Thread.java:680)*
> *
> *
> The log points to this lines:
>
> *at
> org.apache.jmeter.visualizers.GraphVisualizer.updateGui(GraphVisualizer.jav a:140)
> *
> *
> *
> And here is the code:
>
>        public synchronized void updateGui(Sample s) {
>
>         // We have received one more sample
>
>         graph.updateGui(s);
>
>         noSamplesField.setText(Long.toString(s.getCount()));  // Line 140
>
>         dataField.setText(Long.toString(s.getData()));
>
>         averageField.setText(Long.toString(s.getAverage()));
>
>         deviationField.setText(Long.toString(s.getDeviation()));
>
>         throughputField.setText(nf.format(60 * s.getThroughput()) + "/" +
> minute); // $NON-NLS-1$
>
>         medianField.setText(Long.toString(s.getMedian()));
>
>         updateYAxis();
>
>     }
>
> Also *at
> org.apache.jmeter.visualizers.GraphVisualizer.add(GraphVisualizer.java:151) *
>
> *
> *
>
> *    *
>
> *//working*
> *
>
>     public void add(SampleResult res) {
>
>         updateGui(model.addSample(res)); //Line 151
>
>     String filename;
>
>     Calendar cal = Calendar.getInstance();  
>
>         try {
>
>         filename = res.getUrlAsString() + cal.getTime() + ".html";
>
>         filename = filename.replace("http://", "");
>
>         filename = filename.replace('/', '-');
>
>         File file = new File(folderDestination + "/" + filename);
>
>         FileWriter writer = new FileWriter(file);
>
>         writer.write(res.getResponseDataAsString());
>
>         writer.close();
>
>         } catch (IOException ex) {
>
>         ex.printStackTrace();
>
>         }
>
>     }
>
> Could you give me any idea about what should be happening ?
>
> *

Agustín Sabater Piñeiro

unread,
May 11, 2011, 12:11:00 PM5/11/11
to jmeter-...@googlegroups.com
Yes, that was all I got to do for fix the problem. 

Thanks

Agustín Sabater Piñeiro

unread,
Jul 15, 2011, 5:01:51 AM7/15/11
to jmeter-...@googlegroups.com
Hi again, 

Is it possible to know when a test plan has ended after the user has launched it?

Thanks a lot ;)

Andrey Pohilko

unread,
Jul 15, 2011, 5:35:21 AM7/15/11
to jmeter-...@googlegroups.com
There is TestListener interface. Implement it and your code will be called on test start/end

Andrey Pohilko

unread,
Jul 15, 2011, 5:35:54 AM7/15/11
to jmeter-...@googlegroups.com
But remember that only non-gui objects may be notified on test events.

Agustín Sabater Piñeiro

unread,
Aug 23, 2011, 11:31:35 AM8/23/11
to jmeter-...@googlegroups.com
Can I get an identifier for the current execution ? Some number or alphanumeric code...

Is it possible? How? 

Thanks 

Andrey Pohilko

unread,
Aug 23, 2011, 11:50:02 AM8/23/11
to jmeter-...@googlegroups.com
What is "current execution"?

Agustín Sabater Piñeiro

unread,
Aug 30, 2011, 3:22:54 AM8/30/11
to jmeter-...@googlegroups.com
Forget it I solved the problem long ago :)

Thanks

krri...@gmail.com

unread,
Aug 7, 2016, 6:50:48 AM8/7/16
to jmeter-plugins
Hi,

This is Krishna here. I am trying to create a Thread Group plugin in for JMeter. I am unable to find any tutorial that would help me to do it. I have basic knowledge in java. Can you tell me the Where to start with?

Thanks in advance.

On Sunday, February 20, 2011 at 2:44:39 PM UTC+5:30, Andrey Pokhilko wrote:
Agustín,

Extending JMeter is very easy. First thing you need is to choose
plugin type you write. There is listeners, samplers, timers, thread
groups, configs, pre- and post-processors, assertions and controllers.

Which one do you choose? Have you an idea what will be enough for your
degree project?

I don't know articles on extending JMeter except this tutorial:
http://jakarta.apache.org/jmeter/extending/jmeter_tutorial.pdf

When I was starting this project I found that tutorial useless and
just got JMeter's code and looked how they implement out-of-the-box
plugins.

Also you need to know Java programming language and some IDE where
you'll write your code.

One week is enough to write plugin. Hold on, pal!

On 19 фев, 21:22, Agustín Sabater Piñeiro <pinye...@gmail.com> wrote:
> Hello, my name is Agustín, nice to meet you.
>
> My final degree project is to develop a simple plugin for JMeter, this
> is a problem because i dont know very well how I can start the plugin.
> So if you can give me any bog post, or website, so I can start
> developing i would be very thankful to you.
>
> I really need it, because if I dont give some results in a week i
> would be rejected from the college. :(

Andrey Pokhilko

unread,
Aug 7, 2016, 6:52:54 AM8/7/16
to jmeter-...@googlegroups.com

Hi,

Easiest way is to take existing plugin's source code and modify it for your needs. Take it here:https://github.com/undera/jmeter-plugins/tree/master/plugins/casutg


--

Andrey Pokhilko

--
You received this message because you are subscribed to the Google Groups "jmeter-plugins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jmeter-plugin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

krri...@gmail.com

unread,
Aug 7, 2016, 7:13:53 AM8/7/16
to jmeter-plugins
Hi,

I am an amateur here. Can you please help me on how to understand the source?

Andrey Pokhilko

unread,
Aug 7, 2016, 7:30:07 AM8/7/16
to jmeter-...@googlegroups.com

Sorry, but I have not time to mentor you.

Andrey Pokhilko

Agustín Sabater Piñeiro

unread,
Aug 7, 2016, 12:00:58 PM8/7/16
to jmeter-...@googlegroups.com
I solved it yeas ago!! No problem man! ;)


You received this message because you are subscribed to a topic in the Google Groups "jmeter-plugins" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jmeter-plugins/igEutZWY2kM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jmeter-plugin...@googlegroups.com.

krri...@gmail.com

unread,
Aug 26, 2016, 2:25:05 AM8/26/16
to jmeter-plugins
Hi,

I managed to integrate my jar with JMeter. Thanks for your guidance. I just have one small query here. Now, I need to get the path of currently opened(Saved) JMeter script in my code. From where can i get that?

Andrey Pokhilko

unread,
Aug 26, 2016, 2:40:52 AM8/26/16
to jmeter-...@googlegroups.com

jigyasat...@gmail.com

unread,
Mar 7, 2017, 5:46:04 AM3/7/17
to jmeter-plugins
Hello. Can u guide me where should I edit the code.

jigyasat...@gmail.com

unread,
Mar 7, 2017, 6:39:44 AM3/7/17
to jmeter-plugins, jigyasat...@gmail.com
Hi, to be specific, I want to filter out the failed requests from the jmeter.log file and save the new file with the specified name. The code for it is ready. I think i should use synthesis report plugin, Please guide me where to place the code for the same.

Vincent Daburon

unread,
Mar 9, 2017, 3:46:34 AM3/9/17
to jmeter-plugins, jigyasat...@gmail.com
Hi,

This feature (filter out failed request) is all ready in the FilterResult tool

jmeter/bin/FilterResults.sh --success-filter true --output-file filteredout.xml --input-file inputfile.csv 

Documentation :
https://jmeter-plugins.org/wiki/FilterResultsTool/

Regards.
Vincent D.

yasararu...@cse.mrt.ac.lk

unread,
Feb 16, 2018, 11:30:31 PM2/16/18
to jmeter-plugins
I need to implement a sampler plugin for JMeter. I have a problem of testing my code with JMeter. How can I check whether my code is working while it is developing???
I would be pleased if someone can give me a idea on how to do it?

yasararu...@cse.mrt.ac.lk

unread,
Feb 16, 2018, 11:35:32 PM2/16/18
to jmeter-plugins
Hi, 

Can you tell me how you integrate your code with JMeter. I need to develop a sampler plugin for jmeter. I have a problem in checking my code working with JMeter??

Thank you

Andrey Pokhilko

unread,
Feb 17, 2018, 2:24:01 AM2/17/18
to jmeter-...@googlegroups.com

Hi,

The simplest way usually to take source code of existing plugin and start from there.

To validate your code works, you should have unit tests to quicky build and run your code pieces.

Andrey Pokhilko

17.02.2018 07:30, yasararu...@cse.mrt.ac.lk пишет:
--

Yasara Sewwandi

unread,
Feb 17, 2018, 2:39:38 AM2/17/18
to jmeter-...@googlegroups.com
hi,

Can you please tell me how I validate my UI first?? I created a maven project and write some code for UI components. I want to check whether that is working with JMeter. Do I need to build the project and add it to the lib/ext directory? or Can I use plugin manager to do that??
I have no idea on this,Checking my code in JMeter. I would be pleased if you can give me some details on this.

Thank you!

To unsubscribe from this group and stop receiving emails from it, send an email to jmeter-plugins+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "jmeter-plugins" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jmeter-plugins/igEutZWY2kM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jmeter-plugins+unsubscribe@googlegroups.com.

Andrey Pokhilko

unread,
Feb 17, 2018, 2:46:20 AM2/17/18
to jmeter-...@googlegroups.com

Use Unit-test for that, too. Here's example how you do it: https://github.com/undera/jmeter-plugins/blob/e8b2285c678b1de49bf8e8a1b72de69bf3ceb6a6/plugins/udp/src/test/java/kg/apc/jmeter/samplers/UDPSamplerGuiTest.java#L23

Andrey Pokhilko

17.02.2018 10:39, Yasara Sewwandi пишет:
To unsubscribe from this group and stop receiving emails from it, send an email to jmeter-plugin...@googlegroups.com.

Yasara Sewwandi

unread,
Feb 17, 2018, 3:12:12 AM2/17/18
to jmeter-...@googlegroups.com
thank you! I'll check it.

Artem Fedorov

unread,
Feb 17, 2018, 5:20:14 AM2/17/18
to jmeter-...@googlegroups.com

17 февр. 2018 г. 11:12 ДП пользователь "Yasara Sewwandi" <yasararu...@cse.mrt.ac.lk> написал:

Yasara Sewwandi

unread,
Feb 17, 2018, 5:43:45 AM2/17/18
to jmeter-...@googlegroups.com
hi,

thank you ! I tried and it is working.

Best regards,
Yasara

yasararu...@cse.mrt.ac.lk

unread,
Apr 23, 2018, 9:47:18 AM4/23/18
to jmeter-plugins
Hi all,

I faced another problem in integrate testing JMeter plugin codes which I have wrote. Can anyone give me an idea on how to integrate test JMeter sampler plugin codes???

thank you

Yasara Sewwandi

unread,
May 11, 2018, 2:04:52 AM5/11/18
to jmeter-...@googlegroups.com
Hi all,

I am developing a HTTP2 sampler plugin for JMeter. When I run it in JMeter for testing I get this following error. Can someone tell me what this error is and how to solve this??

Thank you

java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/ALPN$ClientProvider
        at org.eclipse.jetty.util.FuturePromise.get(FuturePromise.java:123)
        at sampler.HTTP2Connection.connect(HTTP2Connection.java:83)
        at sampler.HTTP2Request.setConnection(HTTP2Request.java:306)
        at sampler.HTTP2Request.sample(HTTP2Request.java:97)
        at sampler.HTTP2Request.sample(HTTP2Request.java:89)
        at sampler.HTTP2Request.sample(HTTP2Request.java:1)
        at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:498)
        at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:424)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/ALPN$ClientProvider
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at org.eclipse.jetty.alpn.client.ALPNClientConnectionFactory.newConnection(ALPNClientConnectionFactory.java:51)
        at org.eclipse.jetty.io.ssl.SslClientConnectionFactory.newConnection(SslClientConnectionFactory.java:69)
        at org.eclipse.jetty.http2.client.HTTP2Client.lambda$doStart$1(HTTP2Client.java:158)
        at org.eclipse.jetty.http2.client.HTTP2Client$ClientSelectorManager.newConnection(HTTP2Client.java:399)
        at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:488)
        at org.eclipse.jetty.io.ManagedSelector.access$1700(ManagedSelector.java:60)
        at org.eclipse.jetty.io.ManagedSelector$CreateEndPoint.run(ManagedSelector.java:667)
        at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:122)
        at org.eclipse.jetty.util.thread.strategy.ExecutingExecutionStrategy.invoke(ExecutingExecutionStrategy.java:58)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:201)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produce(ExecuteProduceConsume.java:97)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
        ... 1 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.alpn.ALPN$ClientProvider
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 25 more
java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/client/ALPNClientConnection
        at org.eclipse.jetty.util.FuturePromise.get(FuturePromise.java:123)
        at sampler.HTTP2Connection.connect(HTTP2Connection.java:83)
        at sampler.HTTP2Request.setConnection(HTTP2Request.java:306)
        at sampler.HTTP2Request.sample(HTTP2Request.java:97)
        at sampler.HTTP2Request.sample(HTTP2Request.java:89)
        at sampler.HTTP2Request.sample(HTTP2Request.java:1)
        at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:498)
        at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:424)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/client/ALPNClientConnection
        at org.eclipse.jetty.alpn.client.ALPNClientConnectionFactory.newConnection(ALPNClientConnectionFactory.java:51)
        at org.eclipse.jetty.io.ssl.SslClientConnectionFactory.newConnection(SslClientConnectionFactory.java:69)
        at org.eclipse.jetty.http2.client.HTTP2Client.lambda$doStart$1(HTTP2Client.java:158)
        at org.eclipse.jetty.http2.client.HTTP2Client$ClientSelectorManager.newConnection(HTTP2Client.java:399)
        at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:488)
        at org.eclipse.jetty.io.ManagedSelector.access$1700(ManagedSelector.java:60)
        at org.eclipse.jetty.io.ManagedSelector$CreateEndPoint.run(ManagedSelector.java:667)
        at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:122)
        at org.eclipse.jetty.util.thread.strategy.ExecutingExecutionStrategy.invoke(ExecutingExecutionStrategy.java:58)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:201)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produce(ExecuteProduceConsume.java:97)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
        ... 1 more

--

artem....@blazemeter.com

unread,
May 11, 2018, 4:49:55 AM5/11/18
to jmeter-plugins
Hi,

You got NoClassDefFoundError because you missed some jar in your classpath.
Look at this list and compare with libs in you jmeter/lib folder: https://groups.google.com/d/msg/jmeter-plugins/ux9WvkwWb6g/-jDT3U8RAwAJ 

Thanks,
Artem

пятница, 11 мая 2018 г., 9:04:52 UTC+3 пользователь Yasara Sewwandi написал:
To unsubscribe from this group and all its topics, send an email to jmeter-plugin...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages