Announcement Announcement Module
Collapse
No announcement yet.
JMeter & HttpInvoker Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JMeter & HttpInvoker

    hi,

    has any have any experience doing load testing with JMeter on HttpInvoker?

    would like to know if there's an effective way to do a load test on rich clients communicating with web server using HttpInvoker.

    thank you for any advice given.

  • #2
    Not really an answer to your question, but yesterday I started using Grinder - http://grinder.sourceforge.net - and found it excellent. You code it in Jython and it comes with a graphical monitor and HTTP Proxy. We needed to pull apart responses from the server (to extract a flow ID etc) and also sequentially increase a business identifier that each web request was creating, and it performed very well.

    Comment


    • #3
      Two more comments on this, as I've done more work on something similar today:

      1. Using jWebUnit (http://jwebunit.sourceforge.net/) delivers a more user-friendly approach than HttpUnit (it still uses HttpUnit underneith).

      2. Grinder can happily call a JUnit test. As such we're refactoring our tests to serve both as integration tests (jWebUnit/Junit) and stress tests (Grinder calling jWebUnit).

      In connection with your original post about HttpInvoker, Grinder can happily call any Java code as part of the stress test. So Grinder could be used to coordinate the execution of multiple threads (on multiple machines if desired) with a nice console that gives transactions per second etc.

      Comment


      • #4
        yes,

        have tried out grinder 3.0. i'm also impressed by it. probably can use it for a variety of stress tests etc.

        currently i'm using it to run junit test cases which invokes httpinvokers.

        also i'm using JAMon on the server side to collect statistics based on invocations on the server methods. so i'm able to see extra information such

        Hits
        Avg ms.
        Total ms.
        Std Dev ms.
        Min ms.
        Max ms.
        Active
        Avg Active etc

        as such, it gives a much clearer view of the system.

        thanks for the recommendation.

        Comment


        • #5
          But how would one actually perform accurate load testing on a client/server style app, which uses Http Invoker and works based on an RMI call concept or similar . . . You can't simply set URL's and Parameters for the load tester(whether it's JMeter, Jython or AppPerfect) like you would in a traditional web application because of the way HttpInvokerRequestExecutor implementation of choice formates the arguments, which looks like it dumps it all into a stream, serialized, etc.

          I have thought about just running JUnit tests through the Rich Client interface, but it would be nice to be able to gather metrics from some of the more popular tools, like JMeter, AppPerfect, etc.

          Comment


          • #6
            You can write you own sampler for JMeter and do whatever you want. We've done this here with a lot of success. It's pretty easy to do.

            Comment


            • #7
              Thanks for the reply, Jeff. So, if I understand this correctly, by writing a custom Sampler and using that as a Controller, I can mimic the behavior of HttpInvoker? I am currently using CommonsHttpInvokerRequestExecutor for every HttpInvokerProxyFactoryBean bean call. After looking at the Spring Code in the request executor class, it looks like the relevant code is here:

              Code:
              /**
              	 * Execute the given request through Commons HttpClient.
              	 * <p>This method implements the basic processing workflow:
              	 * The actual work happens in this class's template methods.
              	 * @see #createPostMethod
              	 * @see #setRequestBody
              	 * @see #executePostMethod
              	 * @see #validateResponse
              	 * @see #getResponseBody
              	 */
              	protected RemoteInvocationResult doExecuteRequest(
              			HttpInvokerClientConfiguration config, ByteArrayOutputStream baos)
              			throws IOException, ClassNotFoundException {
              
              		PostMethod postMethod = createPostMethod(config);
              		try {
              			setRequestBody(config, postMethod, baos);
              			executePostMethod(config, getHttpClient(), postMethod);
              			validateResponse(config, postMethod);
              			InputStream responseBody = getResponseBody(config, postMethod);
              			return readRemoteInvocationResult(responseBody, config.getCodebaseUrl());
              		}
              		finally {
              			// Need to explicitly release because it might be pooled.
              			postMethod.releaseConnection();
              		}
              	}
              
              	/**
              	 * Create a PostMethod for the given configuration.
              	 * <p>The default implementation creates a standard PostMethod with
              	 * "application/x-java-serialized-object" as "Content-Type" header.
              	 * @param config the HTTP invoker configuration that specifies the
              	 * target service
              	 * @return the PostMethod instance
              	 * @throws IOException if thrown by I/O methods
              	 */
              	protected PostMethod createPostMethod(HttpInvokerClientConfiguration config) throws IOException {
              		PostMethod postMethod = new PostMethod(config.getServiceUrl());
              		if (isAcceptGzipEncoding()) {
              			postMethod.addRequestHeader(HTTP_HEADER_ACCEPT_ENCODING, ENCODING_GZIP);
              		}
              		return postMethod;
              	}
              
              	/**
              	 * Set the given serialized remote invocation as request body.
              	 * <p>The default implementation simply sets the serialized invocation
              	 * as the PostMethod's request body. This can be overridden, for example,
              	 * to write a specific encoding and potentially set appropriate HTTP
              	 * request headers.
              	 * @param config the HTTP invoker configuration that specifies the target service
              	 * @param postMethod the PostMethod to set the request body on
              	 * @param baos the ByteArrayOutputStream that contains the serialized
              	 * RemoteInvocation object
              	 * @throws IOException if thrown by I/O methods
              	 * @see org.apache.commons.httpclient.methods.PostMethod#setRequestBody(java.io.InputStream)
              	 * @see org.apache.commons.httpclient.methods.PostMethod#setRequestEntity
              	 * @see org.apache.commons.httpclient.methods.InputStreamRequestEntity
              	 */
              	protected void setRequestBody(
              			HttpInvokerClientConfiguration config, PostMethod postMethod, ByteArrayOutputStream baos)
              			throws IOException {
              
              		postMethod.setRequestEntity(new ByteArrayRequestEntity(baos.toByteArray(), getContentType()));
              	}
              Given that, would it seem practical to mimic this behavior as a Sampler implementation and plug that into JMeter?

              Comment


              • #8
                Originally posted by jboring View Post
                You can write you own sampler for JMeter and do whatever you want. We've done this here with a lot of success. It's pretty easy to do.
                Continuing w/my last post, would this possibly be accomplised best through a Java Request Sampler Impementation in JMeter?

                Comment


                • #9
                  Hello,
                  We distribute a commercial JMeter plugin which allows this, see:
                  http://ubikloadpack.com

                  To make your tests realistic, you will need to variabilize content in the
                  serialized objects.

                  Our Java Serialization plugin will allow the following:

                  - Easy recording of traffic with JMeter Proxy Server, a Test Plan using
                  custom Sampler will be created

                  - Easy variabilization of requests (which will appear as XML) through as
                  easy syntax as for example ${searchedWord} where searchedWord can come from
                  a CSV or any user defined variable.

                  - Easy extraction of data from responses using JMeter standard Post
                  Processors

                  - Easy debugging of Request/Responses through standard JMeter View Results
                  Tree element
                  Ubik Load Pack - professional Plugins for JMeter

                  Comment

                  Working...
                  X