Tuesday, March 03, 2009

O&B Architect Develops RMI Plugin for JMeter

JM Ibañez, O&B software architect, has recently been working on a project where he had to load test a client-server application where interaction between the client (a Swing app) and the server is via RMI. We've released the code to allow JMeter to record RMI calls as well as play them back.

The code itself is self-contained, and only requires a JMeter binary release (and not the source), and Ant to build.

Source code is hosted at GitHub at: git://github.com/jmibanez/jmeter-rmi-plugin.git

Currently, we don't package release tarballs, so you'll have to clone the app from the above URL via git.

To use, build the JAR file via the 'jar' target, copy the built JAR file to lib/ext inside your JMeter installation, and then copy any required JAR files that your RMI classes will need to lib inside your JMeter installation.

Features:
  • Basic RMI proxy. To capture RMI method calls for a particular object, add the "RMI Proxy" element to the workbench, point the proxy to the actual server's RMI name, and then point your client application to the host and port of the proxy. The proxy will bind the same object name. There are no changes needed on the server end.
  • Basic RMI sampler. The sampler depends on a BeanShell preprocessor to populate the argument list for each method. Methods are named as 'methodname:argument_list'. You also have to add an "RMI Remote Object Config" element to the thread group, which contains the configuration needed to point the samplers to the proper RMI object.

Current limitations:
  • Currently, the RMI Object Config element can only handle one remote object (not multiple RMI objects) in one test plan.
  • If an exception is thrown by a remote method, the RMI sampler treats that as a sample failure, so methods which use exceptions to signal non-fatal error conditions (e.g. invalid input) will be treated as a sample failure.
  • The element that the RMI proxy attaches samplers to is not configurable, and the RMI proxy will use the first Recording Controller in the test plan (or the Workbench if no Recording Controllers are found).
  • The RMI proxy uses introspection and reflection to build the BeanShell preprocessor script to populate RMI sampler method arguments. If the objects exposed via RMI do not follow JavaBean naming conventions or don't have public fields (!!), you will need to edit the preprocessor script by hand to fix this.

No comments:

Post a Comment