jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Pohilko <...@apc.kg>
Subject Re: access log sampler, state thereof
Date Fri, 25 Feb 2011 15:40:47 GMT
Hi, Will,

I've uploaded current snapshot here: http://code.google.com/p/jmeter-
plugins/downloads/detail?name=JMeterPlugins-0.4.1-
snapshot1.zip&can=1&q=#makechanges

Raw Sampler now is pretty simple, you just provide full HTTP request to send 
on wire. 

Massive way of using Raw Sampler is Raw Data Source pre-processor. Add it to 
your test and prepare a file for it. File has simple format:
<request length in bytes>\n
<request data f specified length>[newlines possible]<next request length>\n
<next request data> ... etc...

Then use ${rawData} as Raw Sampler request data. 

Make note that your request data contains \r\n as end of lines.

Again, this is very early stage for "Raw" concept, so your feedback will help 
to make it more transparent and easy to use. I've attached sample test plan 
and data file to start with.

Stay in touch,
Andrey

В сообщении от 25 февраля 2011 01:02:10 автор Will Milspec написал:
> 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
> >thread).
> 
> 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.
> 
> Addendum
> ============================
> 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".
> e.g.:
> '%{rpfParams}r'
> 
> The tomcat access log valve will call
> request.getAttribute("rpfParams").toString()
> 
> 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
>    {
>       pRequest.setAttribute("rpfParams",new
> RecordParamsFilter.ParameterWrapper(pRequest.getParameterMap()));
>       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;
>       }
> 
>       @Override
>       public String toString()
>       {
>          StringBuffer sb = new StringBuffer();
>          for (Iterator it = fMap.entrySet().iterator(); it.hasNext(); )
>          {
>             Map.Entry entry = (Map.Entry) it.next();
>             String[] values = (String[]) entry.getValue();
>             for (String value : values)
>             {
>                sb.append(entry.getKey()).append("=");
>                sb.append(value);
>             }
>             if (it.hasNext())
>             {
>                sb.append("&");
>             }
>          }
>          return sb.toString();
>       }
>    }

Mime
View raw message