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 Andrey Pohilko <ap...@fininfor.ru> on 2010/02/03 16:52:53 UTC

Custom Thread Group

Hello!

 

I'm maintaner of jmeter-plugins project at Google Code and love writing
JMeter plugins very much along with using this plugins at my work for
complex load tests.

I'd like to write my own Thread Group plugin with custom threads
starting/stopping logic (step function like LoadRunner), but there's 2
problems:

1.     Thread Groups does cannot be custom, there's fixed code for thread
groups

2.     Start/end time logic placed in JMeterStandardEngine, not ThreadGroup

 

I can modify JMeterStandardEngine and ThreadGroup code to use new
"Alternative Scheduling" option and send a patch to developers to include in
Jmeter source code, but this is not so elegant way as regular jmeter
plugins. Actually, for now it's the only way for me and I almost implemented
it. But it's ugly way to have an improvement which I cannot share.

 

I think the best way is make Thread Group regular plugin and delegate thread
scheduling calculation logic to it, then anyone will be able to make any
thread scheduling logic without impact on jmeter source code.

 

What would you say?

 

Best wishes,

Andrey Pohilko


RE: Custom Thread Group

Posted by nachiket <na...@gmail.com>.
Hi Andrey,



I know this might a very easy question on this forum.
I am trying to extend JMeter for some specific functionality. I want to
create new custom Threadgroup which will work/schedule test/threads with
custom logic.

I have created CustomThreadGroup class in org.apache.jmeter.threads package
and CustomThreadGroupGui class in org.apache.jmeter.threads.gui package by
extending the AbstractThreadGroup and AbstractThreadGroup classes
respectively.

changed messgages.property also with appropriate label but still my new
customthreadgroup is not visible in Threads -> section in JMeter GUI. how to
get it ? 

I am working on Jmeter-trunk version of JMeter from your shared git svn
repo.
Any detailed pointers will be of great help. 

Thanks
Nachiket.



--
View this message in context: http://jmeter.512774.n5.nabble.com/Custom-Thread-Group-tp542399p5719403.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.

Re: Custom Thread Group

Posted by sebb <se...@gmail.com>.
On 15/02/2010, Andrey Pohilko <ap...@fininfor.ru> wrote:
> It was easier than I expected - I managed to make Thread Groups a regular
>  plugin with ability to add my own and fully compatible with existing test
>  plans.
>
>  It is:
>         1. Extract abstract superclass AbstractThreadGroup and
>  AbstractThreadGroupGui.
>         2. Modify JMeterEngine and ThreadGroup to delegate thread scheduling
>  to ThreadGroup.
>         3. Add menu group "Threads" and place all thread groups under it.
>  Just like Listeners do via MenuFactory.
>
>  Then I'm able to add my custom thread groups and JMeter works perfectly. The
>  only visible problem I see is tree icon for custom thread groups - it is
>  default.
>
>  What'd ya say, sebb? What should I do next if I want this changes to be
>  committed?

Create a Bugzilla enhancement request and attach the code to it.

New files can be attached as is, but any patches should be in unified
diff format (e.g. as generated by Eclipse - but please use a Patch
Root of "Project", not "Workspace").

>
>  С уважением,
>  Андрей Похилько
>  -----Original Message-----
>
> From: Andrey Pohilko [mailto:apc@fininfor.ru]
>  Sent: Tuesday, February 09, 2010 12:34 PM
>  To: 'JMeter Developers List'
>
> Subject: RE: Custom Thread Group
>
>  Hello!
>
>  I mean that I can write custom Listener or Sampler, but can't write custom
>  Thread Group. Or I can but just don't know how?
>
>  С уважением,
>  Андрей Похилько
>  -----Original Message-----
>  From: sebb [mailto:sebbaz@gmail.com]
>  Sent: Tuesday, February 09, 2010 3:14 AM
>  To: JMeter Developers List
>  Subject: Re: Custom Thread Group
>
>  On 03/02/2010, Andrey Pohilko <ap...@fininfor.ru> wrote:
>  > Hello!
>  >
>  >
>  >
>  >  I'm maintaner of jmeter-plugins project at Google Code and love writing
>  >  JMeter plugins very much along with using this plugins at my work for
>  >  complex load tests.
>  >
>  >  I'd like to write my own Thread Group plugin with custom threads
>  >  starting/stopping logic (step function like LoadRunner), but there's 2
>  >  problems:
>  >
>  >  1.     Thread Groups does cannot be custom, there's fixed code for thread
>  >  groups
>  >
>  >  2.     Start/end time logic placed in JMeterStandardEngine, not
>  ThreadGroup
>  >
>  >
>  >
>  >  I can modify JMeterStandardEngine and ThreadGroup code to use new
>  >  "Alternative Scheduling" option and send a patch to developers to include
>  in
>  >  Jmeter source code, but this is not so elegant way as regular jmeter
>  >  plugins. Actually, for now it's the only way for me and I almost
>  implemented
>  >  it. But it's ugly way to have an improvement which I cannot share.
>  >
>  >
>  >
>  >  I think the best way is make Thread Group regular plugin and delegate
>  thread
>  >  scheduling calculation logic to it, then anyone will be able to make any
>  >  thread scheduling logic without impact on jmeter source code.
>  >
>
>  Not sure I understand how you propose doing this.
>
>  Can you explain a bit more what you mean?
>
>  Note that any changes would need to be compatible with existing test plans.
>
>  >
>  >  What would you say?
>  >
>  >
>  >
>  >  Best wishes,
>  >
>  >
>  >  Andrey Pohilko
>  >
>  >
>
>  ---------------------------------------------------------------------
>  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
>
>

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


RE: Custom Thread Group

Posted by Andrey Pohilko <ap...@fininfor.ru>.
It was easier than I expected - I managed to make Thread Groups a regular
plugin with ability to add my own and fully compatible with existing test
plans.

It is:
	1. Extract abstract superclass AbstractThreadGroup and
AbstractThreadGroupGui.
	2. Modify JMeterEngine and ThreadGroup to delegate thread scheduling
to ThreadGroup.
	3. Add menu group "Threads" and place all thread groups under it.
Just like Listeners do via MenuFactory.

Then I'm able to add my custom thread groups and JMeter works perfectly. The
only visible problem I see is tree icon for custom thread groups - it is
default.

What'd ya say, sebb? What should I do next if I want this changes to be
committed?
 
С уважением,
Андрей Похилько
-----Original Message-----
From: Andrey Pohilko [mailto:apc@fininfor.ru] 
Sent: Tuesday, February 09, 2010 12:34 PM
To: 'JMeter Developers List'
Subject: RE: Custom Thread Group

Hello!

I mean that I can write custom Listener or Sampler, but can't write custom
Thread Group. Or I can but just don't know how?
 
С уважением,
Андрей Похилько
-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Tuesday, February 09, 2010 3:14 AM
To: JMeter Developers List
Subject: Re: Custom Thread Group

On 03/02/2010, Andrey Pohilko <ap...@fininfor.ru> wrote:
> Hello!
>
>
>
>  I'm maintaner of jmeter-plugins project at Google Code and love writing
>  JMeter plugins very much along with using this plugins at my work for
>  complex load tests.
>
>  I'd like to write my own Thread Group plugin with custom threads
>  starting/stopping logic (step function like LoadRunner), but there's 2
>  problems:
>
>  1.     Thread Groups does cannot be custom, there's fixed code for thread
>  groups
>
>  2.     Start/end time logic placed in JMeterStandardEngine, not
ThreadGroup
>
>
>
>  I can modify JMeterStandardEngine and ThreadGroup code to use new
>  "Alternative Scheduling" option and send a patch to developers to include
in
>  Jmeter source code, but this is not so elegant way as regular jmeter
>  plugins. Actually, for now it's the only way for me and I almost
implemented
>  it. But it's ugly way to have an improvement which I cannot share.
>
>
>
>  I think the best way is make Thread Group regular plugin and delegate
thread
>  scheduling calculation logic to it, then anyone will be able to make any
>  thread scheduling logic without impact on jmeter source code.
>

Not sure I understand how you propose doing this.

Can you explain a bit more what you mean?

Note that any changes would need to be compatible with existing test plans.

>
>  What would you say?
>
>
>
>  Best wishes,
>
>
>  Andrey Pohilko
>
>

---------------------------------------------------------------------
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: Custom Thread Group

Posted by Andrey Pohilko <ap...@fininfor.ru>.
Hello!

I mean that I can write custom Listener or Sampler, but can't write custom
Thread Group. Or I can but just don't know how?
 
С уважением,
Андрей Похилько
-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Tuesday, February 09, 2010 3:14 AM
To: JMeter Developers List
Subject: Re: Custom Thread Group

On 03/02/2010, Andrey Pohilko <ap...@fininfor.ru> wrote:
> Hello!
>
>
>
>  I'm maintaner of jmeter-plugins project at Google Code and love writing
>  JMeter plugins very much along with using this plugins at my work for
>  complex load tests.
>
>  I'd like to write my own Thread Group plugin with custom threads
>  starting/stopping logic (step function like LoadRunner), but there's 2
>  problems:
>
>  1.     Thread Groups does cannot be custom, there's fixed code for thread
>  groups
>
>  2.     Start/end time logic placed in JMeterStandardEngine, not
ThreadGroup
>
>
>
>  I can modify JMeterStandardEngine and ThreadGroup code to use new
>  "Alternative Scheduling" option and send a patch to developers to include
in
>  Jmeter source code, but this is not so elegant way as regular jmeter
>  plugins. Actually, for now it's the only way for me and I almost
implemented
>  it. But it's ugly way to have an improvement which I cannot share.
>
>
>
>  I think the best way is make Thread Group regular plugin and delegate
thread
>  scheduling calculation logic to it, then anyone will be able to make any
>  thread scheduling logic without impact on jmeter source code.
>

Not sure I understand how you propose doing this.

Can you explain a bit more what you mean?

Note that any changes would need to be compatible with existing test plans.

>
>  What would you say?
>
>
>
>  Best wishes,
>
>
>  Andrey Pohilko
>
>

---------------------------------------------------------------------
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: Custom Thread Group

Posted by sebb <se...@gmail.com>.
On 03/02/2010, Andrey Pohilko <ap...@fininfor.ru> wrote:
> Hello!
>
>
>
>  I'm maintaner of jmeter-plugins project at Google Code and love writing
>  JMeter plugins very much along with using this plugins at my work for
>  complex load tests.
>
>  I'd like to write my own Thread Group plugin with custom threads
>  starting/stopping logic (step function like LoadRunner), but there's 2
>  problems:
>
>  1.     Thread Groups does cannot be custom, there's fixed code for thread
>  groups
>
>  2.     Start/end time logic placed in JMeterStandardEngine, not ThreadGroup
>
>
>
>  I can modify JMeterStandardEngine and ThreadGroup code to use new
>  "Alternative Scheduling" option and send a patch to developers to include in
>  Jmeter source code, but this is not so elegant way as regular jmeter
>  plugins. Actually, for now it's the only way for me and I almost implemented
>  it. But it's ugly way to have an improvement which I cannot share.
>
>
>
>  I think the best way is make Thread Group regular plugin and delegate thread
>  scheduling calculation logic to it, then anyone will be able to make any
>  thread scheduling logic without impact on jmeter source code.
>

Not sure I understand how you propose doing this.

Can you explain a bit more what you mean?

Note that any changes would need to be compatible with existing test plans.

>
>  What would you say?
>
>
>
>  Best wishes,
>
>
>  Andrey Pohilko
>
>

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