[Jakarta-jmeter Wiki] Update of MysqlCollectorPlugin by brettcave

2010-02-24 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Jakarta-jmeter Wiki 
for change notification.

The MysqlCollectorPlugin page has been changed by brettcave.
http://wiki.apache.org/jakarta-jmeter/MysqlCollectorPlugin

--

New page:
JMeter currently supports file-based listeners. This is a patch that configures 
a Listener to log to MySQL.

The patch is thoroughly untested, most likely highly-buggy and not very 
efficient with resources, so take some time to go over and make changes where 
you see fit before using it (I am not a developer, just able to throw together 
a bit of code). Hope it helps though.

It was primarily designed to save HTTPSample responses to a database for 
reporting purposes.

Some areas that require attention: 
 * Database connection - expensive to create and break down connection after 
each sample is received. This should be configured as a persistent connection
 * Schema - unoptimized (no keys) and a very lazy way of loading. A lot of 
text or unvalidated varchar lengths.
 * Checking of data - if sampler returns null data, it may causing NPE's. No 
escaping of contents. the responseData has been commented, as theres a lot of 
work to be done with HTML responses.
 * GUI / Driver initialization - Can add a driver drop down list to use more 
than just mysql connector J, but JDBC is all there is for now.
 * Resources - no resources for mysql_collector means unfriendly names in 
context menu's (in gui)
 * Packaging - currently has to be patched into (2.3.4 RC3) JMeter. I built it 
off this tag from SVN. Would be nice if it could be packaged in a tarball 
consisting of 1 or 2 jars that can be extracted to JMeter/lib directory so no 
re-compiling is needed. I've seen this with other plugings, but not sure how to 
go about it.

Usage / Notes:
 1. Check out JMeter
 2. Apply patch
 3. Add mysql-connector-jdbc to project/lib directory
 4. Update classpath (if running from Eclipse) to include this library.
 5. Run GUI. The listener should be there and configurable.
 6. Make improvements and send patches / edit here ;)

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



New attachment added to page MysqlCollectorPlugin on Jakarta-jm eter Wiki

2010-02-24 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page MysqlCollectorPlugin for change 
notification. An attachment has been added to that page by brettcave. Following 
detailed information is available:

Attachment name: JMeter_MysqlCollector.patch
Attachment size: 17512
Attachment link: 
http://wiki.apache.org/jakarta-jmeter/MysqlCollectorPlugin?action=AttachFiledo=gettarget=JMeter_MysqlCollector.patch
Page link: http://wiki.apache.org/jakarta-jmeter/MysqlCollectorPlugin

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



[Jakarta-jmeter Wiki] Update of MysqlCollectorPlugin by JMeterAdmin

2010-02-24 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Jakarta-jmeter Wiki 
for change notification.

The MysqlCollectorPlugin page has been changed by JMeterAdmin.
The comment on this change is: Add link to attachment.
http://wiki.apache.org/jakarta-jmeter/MysqlCollectorPlugin?action=diffrev1=1rev2=2

--

- JMeter currently supports file-based listeners. This is a patch that 
configures a Listener to log to MySQL.
+ JMeter currently supports file-based listeners. This is a patch that 
configures a Listener to log to MySQL: 
[[attachment:JMeter_MysqlCollector.patch]]
  
  The patch is thoroughly untested, most likely highly-buggy and not very 
efficient with resources, so take some time to go over and make changes where 
you see fit before using it (I am not a developer, just able to throw together 
a bit of code). Hope it helps though.
  

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



svn commit: r915933 - /jakarta/jmeter/trunk/xdocs/usermanual/get-started.xml

2010-02-24 Thread sebb
Author: sebb
Date: Wed Feb 24 19:17:39 2010
New Revision: 915933

URL: http://svn.apache.org/viewvc?rev=915933view=rev
Log:
Improve docn of -G option

Modified:
jakarta/jmeter/trunk/xdocs/usermanual/get-started.xml

Modified: jakarta/jmeter/trunk/xdocs/usermanual/get-started.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/usermanual/get-started.xml?rev=915933r1=915932r2=915933view=diff
==
--- jakarta/jmeter/trunk/xdocs/usermanual/get-started.xml (original)
+++ jakarta/jmeter/trunk/xdocs/usermanual/get-started.xml Wed Feb 24 19:17:39 
2010
@@ -282,6 +282,7 @@
 p-n This specifies JMeter is to run in non-gui mode/p
 p-t [name of JMX file that contains the Test Plan]./p
 p-l [name of JTL file to log sample results to]./p
+p-j [name of JMeter run log file]./p
 p-r Run the test in the servers specified by the JMeter property 
remote_hosts/p
 p-R [list of remote servers] Run the test in the specified remote servers/p
 pThe script also lets you specify the optional firewall/proxy server 
information:/p
@@ -302,7 +303,7 @@
 /p
 pTo run the test from the client in non-GUI mode, use the following 
command:/p
 pre
-jmeter -n -t testplan.jmx -r [-Gprop=val] [-Z]
+jmeter -n -t testplan.jmx -r [-Gprop=val] [-Gglobal.properties] [-Z]
 where:
 -G is used to define JMeter properties to be set in the servers
 -X means exit the servers at the end of the test
@@ -317,6 +318,7 @@
 p-D[prop_name]=[value] - defines a java system property value./p
 p-J[prop name]=[value] - defines a local JMeter property./p
 p-G[prop name]=[value] - defines a JMeter property to be sent to all remote 
servers./p
+p-G[propertyfile] - defines a file containing JMeter properties to be sent 
to all remote servers./p
 p-L[category]=[priority] - overrides a logging setting, setting a particular 
category to the given priority level./p
 pThe -L flag can also be used without the category name to set the root 
logging level./p
pbExamples/b:



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



Re: Effectively monitoring target resources with jmeter?

2010-02-24 Thread Brett Cave
On Wed, Feb 24, 2010 at 9:07 PM, sebb seb...@gmail.com wrote:

 On 24/02/2010, Brett Cave brettc...@gmail.com wrote:
  MysqlCollector plugin added to JMeter wiki:
 
   http://wiki.apache.org/jakarta-jmeter/MysqlCollectorPlugin (check
   attachments for the patch).

 Have a look at the Summariser class - this uses the TestListener
 interface for setUp/tearDown of items that are needed for each test.
 This could be used for setting up and closing the connection etc.


Ok perfect, will do that. Used the ResultSaver class for reference to get
familiar with plugin development,


 Most of the code is generic SQL - however the database creation is not.
 Since that only has to be done once, it could be done outside JMeter.

 By database creation, do you mean table creation or setting up of the
connection? The table will only be created if it doesn't exist and the
create table option is selected from the GUI.



 Provided that you implement the correct interface(s), JMeter will find
 the add-ons.
 That's how it finds all the existing samplers and listeners etc.
 Just put them in a jar and put the jar in lib/ext.

 To avoid problems with missing properties, override getStaticLabel()
 rather than getLabelResource().


Great, will do. Not sure why it was looking for the default org.apache
package. The code was originally in org.apache, but then moved to a new one,
re-archived the jar in lib/ext (with JMeter closed) and then started JMeter
again. possibly cached classes somewhere?



 Or use the TestBean method for implementing the GUI; each class has
 its own resource file.

 This is starting to be more appropriate for the JMeter developer
 mailing list ...


Done


Re: Effectively monitoring target resources with jmeter?

2010-02-24 Thread sebb
On 24/02/2010, Brett Cave brettc...@gmail.com wrote:
 On Wed, Feb 24, 2010 at 9:07 PM, sebb seb...@gmail.com wrote:

   On 24/02/2010, Brett Cave brettc...@gmail.com wrote:
MysqlCollector plugin added to JMeter wiki:
   
 http://wiki.apache.org/jakarta-jmeter/MysqlCollectorPlugin (check
 attachments for the patch).
  

  Have a look at the Summariser class - this uses the TestListener
   interface for setUp/tearDown of items that are needed for each test.
   This could be used for setting up and closing the connection etc.
  


 Ok perfect, will do that. Used the ResultSaver class for reference to get
  familiar with plugin development,


  
   Most of the code is generic SQL - however the database creation is not.
   Since that only has to be done once, it could be done outside JMeter.
  

  By database creation, do you mean table creation or setting up of the
  connection? The table will only be created if it doesn't exist and the
  create table option is selected from the GUI.



Table creation.

Users may wish to use Derby or Oracle or some other database.

So long as the appropriate column names and types are created, the
rest of the code should then work with any JDBC database.


   Provided that you implement the correct interface(s), JMeter will find
   the add-ons.
   That's how it finds all the existing samplers and listeners etc.
   Just put them in a jar and put the jar in lib/ext.
  
   To avoid problems with missing properties, override getStaticLabel()
   rather than getLabelResource().
  


 Great, will do. Not sure why it was looking for the default org.apache
  package. The code was originally in org.apache, but then moved to a new one,
  re-archived the jar in lib/ext (with JMeter closed) and then started JMeter
  again. possibly cached classes somewhere?


JMeter does not cache classes between runs.



   Or use the TestBean method for implementing the GUI; each class has
   its own resource file.
  
   This is starting to be more appropriate for the JMeter developer
   mailing list ...
  


 Done


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



[Jakarta-jmeter Wiki] Update of JMeterAutomatedRemoteTes ting by brettcave

2010-02-24 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Jakarta-jmeter Wiki 
for change notification.

The JMeterAutomatedRemoteTesting page has been changed by brettcave.
The comment on this change is: -G parameter does work with properties files, 
updated documentation..
http://wiki.apache.org/jakarta-jmeter/JMeterAutomatedRemoteTesting?action=diffrev1=3rev2=4

--

   * have touched on remote testing (from GUI is fine)
  
  = Set up =
-  * In your existing test plan, make sure that any variations in testing make 
use of variables. For example, if running a HTTP sampler, use HTTP Request 
Defaults to specify a host as ${__P(targetHost)}. Other useful places for 
variables might include number of threads, ramp-up period or scheduler duration 
in a thread group, using a format of ${__P(threadgroup.threads,500)}  (The __P 
function is shorthand for __parameter. See the userguide for more info on using 
this parameter).
+  * In your existing test plan, make sure that any variations in testing make 
use of variables. For example, if running a HTTP sampler, use HTTP Request 
Defaults to specify a host as `${__P(targetHost)}`. Other useful places for 
variables might include number of threads, ramp-up period or scheduler duration 
in a thread group, using a format of `${__P(threadgroup.threads,500)}`  (The 
`__P` function is shorthand for `__parameter`. See the userguide for more info 
on using this parameter).
   * Save your test plan and properties file to a directory.
   * Create a properties file containing all your variables. E.g. 
mytest.properties could contain threadgroup.threads=100, 
targetHost=my-target-host.com
   * The test plan does not need Listeners, as this will be configured via 
parameters. This will improve performance on the testing.
   * Run the test mode in stand-alone mode (i.e. no remote servers):   `jmeter 
-n -t load_test.jmx -l load_test_report.jtl -q mytest.properties -j mytest.log`
+  * 1 small piece of functionality missing is the ability to set global 
variables from a property file. the -q parameter defines an additional 
property file, which is the equivalent of setting properties for the contents 
of the file using the -J parameter. These parameters are not global however, as 
would be set by the -G parameter. The -G parameter can reference either a 
property in the format of `-Gprop=val` or a properties file, such as 
`-G./myglobal.properties`
-  * 1 small piece of functionality missing is the ability to set global 
variables from a property file. the -q parameter defines an additional 
property file, which is the equivalent of setting properties for the contents 
of the file using the -J parameter. This parameters are not global however, as 
would be set by the -G parameter. the following bash script (if your using 
Linux) would help with converting a properties file to global properties:
- 
- {{{
- for var in `grep -vE ^(#|$) mytest.properties`; do
-   GLOBAL_VARS=-G${var} ${GLOBAL_VARS}
- done
- }}}
- This is a relatively simple bash expansion, and will break if there are any 
spaces in variable names or values (e.g. test.description=My Test - the space 
would break the bash for loop.)
  
   * On all client machines, start up JMeter server, ensuring that firewall is 
not blocking connections (clients must all be on the same subnet).
   * On JMeter controller (the host initializing the test), run the test with 
the -R parameter (can be run using -r and specfiying hosts in jmeter properties 
file):
  
- `jmeter -n -t load_test.jmx -l load_test_report.jtl -q mytest.properties -j 
mytest.log -R remotehost1,remotehost2 ${GLOBAL_VARS}`
+ `jmeter -n -t load_test.jmx -l load_test_report.jtl -Gmytest.properties -j 
mytest.log -R remotehost1,remotehost2 ${GLOBAL_VARS}`
  
  Note that load injection to targets will be a increased as a ratio of number 
of threads per thread group multiplied by number of client machines.
  
@@ -45, +38 @@

  # If set as an environment var, then use it, otherwise leave it unset.
  HOST_LIST=${HOST_LIST:+-R ${HOST_LIST}}
  
+ # Had an issue with -Gglobal.properties file, so parsed this into individual 
properties.
  for var in `grep -vE ^#|^$ ${JMETER_CUSTOM_PROPERTIES}`; do
  GLOBAL_VARS=-G${var} ${GLOBAL_VARS}
  done
+ 
+ # But after testing, it does work as expected.
+ GLOBAL_VARS=-G${JMETER_CUSTOM_PROPERTIES}
  
  if [ -f ${loadtest}.jmx ]; then
  echo Running ${loadtest} with:

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



svn commit: r915966 - in /jakarta/jmeter/trunk: docs/images/screenshots/ src/core/org/apache/jmeter/resources/ src/protocol/mail/org/apache/jmeter/protocol/mail/sampler/gui/ xdocs/images/screenshots/

2010-02-24 Thread sebb
Author: sebb
Date: Wed Feb 24 20:26:22 2010
New Revision: 915966

URL: http://svn.apache.org/viewvc?rev=915966view=rev
Log:
Fix up Mail Reader Sampler GUI

Modified:
jakarta/jmeter/trunk/docs/images/screenshots/mailreader_sampler.png

jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties

jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/mail/sampler/gui/MailReaderSamplerGui.java
jakarta/jmeter/trunk/xdocs/images/screenshots/mailreader_sampler.png
jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml

Modified: jakarta/jmeter/trunk/docs/images/screenshots/mailreader_sampler.png
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/docs/images/screenshots/mailreader_sampler.png?rev=915966r1=915965r2=915966view=diff
==
Binary files - no diff available.

Modified: 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties?rev=915966r1=915965r2=915966view=diff
==
--- 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties 
(original)
+++ 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties 
Wed Feb 24 20:26:22 2010
@@ -462,8 +462,8 @@
 mail_reader_password=Password:
 mail_reader_port=Server Port (optional):
 mail_reader_server=Server Host:
-mail_reader_server_type=JavaMail Protocol (e.g. pop3, imaps):
-mail_reader_storemime=Store the message using MIME
+mail_reader_server_type=Protocol (e.g. pop3, imaps):
+mail_reader_storemime=Store the message using MIME (raw)
 mail_reader_title=Mail Reader Sampler
 mail_sent=Mail sent successfully
 mailer_attributes_panel=Mailing attributes

Modified: 
jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/mail/sampler/gui/MailReaderSamplerGui.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/mail/sampler/gui/MailReaderSamplerGui.java?rev=915966r1=915965r2=915966view=diff
==
--- 
jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/mail/sampler/gui/MailReaderSamplerGui.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/mail/sampler/gui/MailReaderSamplerGui.java
 Wed Feb 24 20:26:22 2010
@@ -17,13 +17,18 @@
  */
 package org.apache.jmeter.protocol.mail.sampler.gui;
 
+import java.awt.BorderLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.FocusEvent;
 import java.awt.event.FocusListener;
 
+import javax.swing.Box;
 import javax.swing.ButtonGroup;
 import javax.swing.JCheckBox;
+import javax.swing.JComponent;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
@@ -32,11 +37,11 @@
 import javax.swing.event.ChangeListener;
 
 import org.apache.jmeter.gui.util.HorizontalPanel;
+import org.apache.jmeter.gui.util.VerticalPanel;
 import org.apache.jmeter.protocol.mail.sampler.MailReaderSampler;
 import org.apache.jmeter.samplers.gui.AbstractSamplerGui;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.util.JMeterUtils;
-import org.apache.jorphan.gui.layout.VerticalLayout;
 
 public class MailReaderSamplerGui extends AbstractSamplerGui implements 
ActionListener, FocusListener {
 
@@ -157,54 +162,36 @@
 mrs.setStoreMimeMessage(storeMimeMessageBox.isSelected());
 }
 
-// TODO - fix GUI layout problems
-
 /*
  * Helper method to set up the GUI screen
  */
 private void init() {
-setLayout(new VerticalLayout(5, VerticalLayout.BOTH, 
VerticalLayout.TOP));
+setLayout(new BorderLayout());
 setBorder(makeBorder());
-add(makeTitlePanel());
 
-JPanel serverTypePanel = new JPanel();
-serverTypePanel.add(new JLabel(ServerTypeLabel));
+JPanel settingsPanel = new JPanel(new GridBagLayout());
+GridBagConstraints gbc = getConstraints();
+
 serverTypeBox = new JTextField(20);
 serverTypeBox.addActionListener(this);
 serverTypeBox.addFocusListener(this);
-serverTypePanel.add(serverTypeBox);
-add(serverTypePanel);
-
-JPanel serverPanel = new JPanel();
-serverPanel.add(new JLabel(ServerLabel));
+addField(settingsPanel, ServerTypeLabel, serverTypeBox, gbc);
+
 serverBox = new JTextField(20);
-serverPanel.add(serverBox);
-add(serverPanel);
+addField(settingsPanel, ServerLabel, serverBox, gbc);
 
-JPanel portPanel = new JPanel();
-portPanel.add(new JLabel(PortLabel));
 portBox = new JTextField(20);
- 

[Jakarta-jmeter Wiki] Update of JMeterAutomatedRemoteTes ting by JMeterAdmin

2010-02-24 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Jakarta-jmeter Wiki 
for change notification.

The JMeterAutomatedRemoteTesting page has been changed by JMeterAdmin.
The comment on this change is: Clarify properties/variables.
http://wiki.apache.org/jakarta-jmeter/JMeterAutomatedRemoteTesting?action=diffrev1=4rev2=5

--

   * have touched on remote testing (from GUI is fine)
  
  = Set up =
-  * In your existing test plan, make sure that any variations in testing make 
use of variables. For example, if running a HTTP sampler, use HTTP Request 
Defaults to specify a host as `${__P(targetHost)}`. Other useful places for 
variables might include number of threads, ramp-up period or scheduler duration 
in a thread group, using a format of `${__P(threadgroup.threads,500)}`  (The 
`__P` function is shorthand for `__parameter`. See the userguide for more info 
on using this parameter).
+  * In your existing test plan, make sure that any variations in testing make 
use of functions or variables. For example, if running a HTTP sampler, use HTTP 
Request Defaults to specify a host as `${__P(targetHost,localhost)}`. Other 
useful places for parameterisation might include number of threads, ramp-up 
period or scheduler duration in a thread group, using a format of 
`${__P(threadgroup.threads,500)}`  (The `__P` function is shorthand for 
`__property`. See the 
[http://jakarta.apache.org/jmeter/usermanual/functions.html#__P user manual] 
for more info on using this function).
   * Save your test plan and properties file to a directory.
   * Create a properties file containing all your variables. E.g. 
mytest.properties could contain threadgroup.threads=100, 
targetHost=my-target-host.com
   * The test plan does not need Listeners, as this will be configured via 
parameters. This will improve performance on the testing.
   * Run the test mode in stand-alone mode (i.e. no remote servers):   `jmeter 
-n -t load_test.jmx -l load_test_report.jtl -q mytest.properties -j mytest.log`
-  * 1 small piece of functionality missing is the ability to set global 
variables from a property file. the -q parameter defines an additional 
property file, which is the equivalent of setting properties for the contents 
of the file using the -J parameter. These parameters are not global however, as 
would be set by the -G parameter. The -G parameter can reference either a 
property in the format of `-Gprop=val` or a properties file, such as 
`-G./myglobal.properties`
+  * The -q parameter defines an additional property file, which is the 
equivalent of setting properties for the contents of the file using the -J 
parameter. These parameters are not sent to remote servers; for that one can 
use the -G parameter. The -G parameter can reference either a property in the 
format of `-Gprop=val` or a properties file, such as `-G./myglobal.properties`
- 
+  * Properties can be referenced anywhere in the test plan using the `__P()` 
function - e.g. `${__P(propname)}`
+  * There is no way currently to predefine variables, however the User Defined 
Variables table on the Test Plan can be used to create variables from 
properties. For example:
+ || Name: || Value: ||
+ || HOST  || `${__P(host,localhost)}` ||
   * On all client machines, start up JMeter server, ensuring that firewall is 
not blocking connections (clients must all be on the same subnet).
   * On JMeter controller (the host initializing the test), run the test with 
the -R parameter (can be run using -r and specfiying hosts in jmeter properties 
file):
  

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



svn commit: r916042 - /jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml

2010-02-24 Thread sebb
Author: sebb
Date: Wed Feb 24 23:44:35 2010
New Revision: 916042

URL: http://svn.apache.org/viewvc?rev=916042view=rev
Log:
tweak

Modified:
jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml

Modified: jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=916042r1=916041r2=916042view=diff
==
--- jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
+++ jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml Wed Feb 24 
23:44:35 2010
@@ -309,8 +309,8 @@
  pSee jmeter.properties file for the details of the settings. 
  If the HTTPResponse.parser property is not set, JMeter reverts to the 
previous behaviour,
  i.e. only text/html responses will be scanned/p
-bEmulating slow connections:/bbr/br
-The HttpClient sampler supports emulation of slow connections; see the 
following entries in jmeter.proerties:
+bEmulating slow connections (HttpClient only):/bbr/br
+The HttpClient version of the sampler supports emulation of slow connections; 
see the following entries in jmeter.proerties:
 pre
 # Define characters per second  0 to emulate slow connections
 #httpclient.socket.http.cps=0



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



svn commit: r916067 - in /jakarta/jmeter/trunk/src: jorphan/org/apache/jorphan/gui/GuiUtils.java protocol/http/org/apache/jmeter/protocol/http/gui/HTTPArgumentsPanel.java protocol/http/org/apache/jmet

2010-02-24 Thread sebb
Author: sebb
Date: Thu Feb 25 00:55:27 2010
New Revision: 916067

URL: http://svn.apache.org/viewvc?rev=916067view=rev
Log:
Better implementation of fixsize() for table columns

Modified:
jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/GuiUtils.java

jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPArgumentsPanel.java

jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java

Modified: jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/GuiUtils.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/GuiUtils.java?rev=916067r1=916066r2=916067view=diff
==
--- jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/GuiUtils.java 
(original)
+++ jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/GuiUtils.java Thu 
Feb 25 00:55:27 2010
@@ -21,6 +21,9 @@
 import java.awt.Component;
 
 import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
 
 public class GuiUtils {
 
@@ -42,4 +45,23 @@
 return pane;
 }
 
+/**
+ * Fix the size of a column according to the header text.
+ * 
+ * @param column to be resized
+ * @param table containing the column
+ */
+public static void fixSize(TableColumn column, JTable table) {
+TableCellRenderer rndr;
+rndr = column.getHeaderRenderer();
+if (rndr == null){
+rndr = table.getTableHeader().getDefaultRenderer();
+}
+Component c = rndr.getTableCellRendererComponent(
+table, column.getHeaderValue(), false, false, -1, 
column.getModelIndex());
+int width = c.getPreferredSize().width+10;
+column.setMaxWidth(width);
+column.setPreferredWidth(width);
+column.setResizable(false);
+}
 }

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPArgumentsPanel.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPArgumentsPanel.java?rev=916067r1=916066r2=916067view=diff
==
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPArgumentsPanel.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPArgumentsPanel.java
 Thu Feb 25 00:55:27 2010
@@ -21,7 +21,6 @@
 import java.util.Iterator;
 
 import javax.swing.JTable;
-import javax.swing.table.TableColumn;
 
 import org.apache.jmeter.config.Arguments;
 import org.apache.jmeter.config.gui.ArgumentsPanel;
@@ -29,6 +28,7 @@
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.testelement.property.PropertyIterator;
 import org.apache.jmeter.util.JMeterUtils;
+import org.apache.jorphan.gui.GuiUtils;
 import org.apache.jorphan.gui.ObjectTableModel;
 import org.apache.jorphan.reflect.Functor;
 
@@ -71,11 +71,8 @@
 
 @Override
 protected void sizeColumns(JTable table) {
-int resizeMode = table.getAutoResizeMode();
-table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
-fixSize(table.getColumn(INCLUDE_EQUALS));
-fixSize(table.getColumn(ENCODE_OR_NOT));
-table.setAutoResizeMode(resizeMode);
+GuiUtils.fixSize(table.getColumn(INCLUDE_EQUALS), table);
+GuiUtils.fixSize(table.getColumn(ENCODE_OR_NOT), table);
 }
 
 @Override
@@ -86,14 +83,6 @@
 return arg;
 }
 
-private void fixSize(TableColumn column) {
-column.sizeWidthToFit();
-// column.setMinWidth(column.getWidth());
-column.setMaxWidth((int) (column.getWidth() * 1.5));
-column.setWidth(column.getMaxWidth());
-column.setResizable(false);
-}
-
 public HTTPArgumentsPanel() {
 super(JMeterUtils.getResString(paramtable)); //$NON-NLS-1$
 }

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java?rev=916067r1=916066r2=916067view=diff
==
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java
 Thu Feb 25 00:55:27 2010
@@ -36,7 +36,6 @@
 import javax.swing.JTable;
 import javax.swing.ListSelectionModel;
 import javax.swing.table.TableCellEditor;
-import javax.swing.table.TableColumn;
 
 import org.apache.jmeter.gui.util.FileDialoger;
 import org.apache.jmeter.gui.util.HeaderAsPropertyRenderer;
@@ -44,6 +43,7 @@
 import