You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Guy Ferraiolo <gu...@cnet.com> on 2008/02/14 22:33:18 UTC

Re: flood random substitution patch

Folks

Here's that flood patch again.  People have actually asked for this so I
hope it will be possible to consider it.  The total size of the changes
is small so it won't be a lot of work.

Here's what it does.
You specify one or more items with two elements in your config file.
The two elements are the substitution variable and the associate
substitution file.  You use the substitution variable in the URL and the
text of the variable is replaced with a line from the substitution file.

Example:
URL: http://site.com/query?${myquery}

If the line randomly selected from the substition file were 'article=10'
the URL sent by flood would be http://site.com/query?article=10.

Please consider this patch.  It makes flood much more usable.  If there
are any questions, just ask.

Guy


On Wed, 2007-12-19 at 18:06 -0500, Guy Ferraiolo wrote:
> Folks
> 
> Attached is a patch that implements a random substitution feature for
> flood.  You need a requesttemplate, one or more substitution variables
> of the form ${varname) in the requesttemplate and a substitution file
> formatted with one value per newline delimited line.  There may be more
> than one substitution variable per URL.  The variables and files are
> referred to as subst variables and subst files.  Each time the URL is
> sent the subst variable is replaced with one line randomly selected from
> the subst file.  Any part of the requesttemplate can be randomly
> substituted, protocol, host, port, etc.  The algorithm tries to make the
> creation time of the substitution independent of the size of the subst
> file.  The randomness of the selection can be adversely impacted if the
> sizes of the different entries in the subst file vary considerably.
> 
> In addition to the code changes implementing this there is also a sample
> flood configuration file (subst-example.xml), an updated flood.dtd and a
> sample subst file (subprojects) that the subst-example.xml references so
> you can see the feature in action.
> 
> This code is reasonably well tested although this precise version is
> somewhat new, I wanted to build against the most recent release of flood
> I could get.
> 
> There are many possible enhancements to this but the current version is
> a reasonable initial functionality.  In particular this can only
> randomize parts of the requesttemplate so headers can't be randomized,
> at least at this time.
> 
> I am under the impression the patch is in the required format.  Let me
> know of any required changes.  I hope this is found useful.
> 
> Thanks,
> 
> Guy
> 
-- 
Guy Ferraiolo                                   mailto:guyf@CNET.com
Performance Measurement & Analysis              http://CNET.com
CNET                                            tel: 1.908.541.3739
1200 Route 22 East                              fax: 1.908.575.7474
Bridgewater, NJ 08807                           cel: 1.732.618.0250