jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Will Milspec <>
Subject Re: access log sampler, state thereof
Date Thu, 24 Feb 2011 22:02:10 GMT
Some comments:

>>to recreate "actual load" from a very busy system.
>Actual load is usually concurrent. In most cases you dont get these values
>from a log file (and its important that the same session use the same

Right. We desire session recreation. From a "functional" perspective
(recreating actual load), we find that our production servers can get a lot
of "bot crawls". Each bot request uses its own session. (5000 requests=5000
sessions). These "smal sessions" add overhead when those sessions expire. If
all 5000 requests came from the same session, we would not see the "session
expiration overhead".

Technically I've read that Jmeter basically tries to 'recreate sessions' by
lumping together requests from the same IP address, but have not confirmed
how the access log sampler simulates these sessions.

Ideally the access log sampler would work as follows:
-recognize 'session id' to  the access log
-access log sampler groups requests from the same sessions into the same
session. (it can't re-use the exact same session ID as the servlet container
generates it automatically. ).

>If you can generate all POST and GET data, you could use HTTP Raw Sampler
>(custom sampler, not shipped with JMeter). It allows you have full control
Where can I find the raw sampler.

fwiw, here's (pretty trivial) example code to add the post parameter to the
tomcat access log. It adds overhead, mostly when the access log valve prints
out the parameters.

A. Access log format to get a request attribute, here called "rpf params".

The tomcat access log valve will call

B. Add a filter that adds sets a 'parameter wrapper' as a request attribute.
   public void doFilter(ServletRequest pRequest, ServletResponse pResponse,
FilterChain pChain) throws IOException, ServletException
      pChain.doFilter(pRequest, pResponse);

    * Class to wrap  parameter map. Main "work" occurs in the "toString".
    * Exists to allow printing of both "get" and "post" parameters.
   public class ParameterWrapper
      Map fMap;

      public ParameterWrapper(Map pMap)
         fMap = pMap;

      public String toString()
         StringBuffer sb = new StringBuffer();
         for (Iterator it = fMap.entrySet().iterator(); it.hasNext(); )
            Map.Entry entry = (Map.Entry);
            String[] values = (String[]) entry.getValue();
            for (String value : values)
            if (it.hasNext())
         return sb.toString();

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message