httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guy Ferraiolo" <guy.ferrai...@cnet.com>
Subject RE: fixed range for random variables
Date Thu, 19 Aug 2004 16:18:39 GMT
Is this in the source archive now?

Thanks!

Guy 

-----Original Message-----
From: Jacek Prucia [mailto:jacek.prucia@acn.waw.pl] 
Sent: Wednesday, May 12, 2004 9:37 AM
To: test-dev@httpd.apache.org
Subject: fixed range for random variables


Really nifty flood feature is the ability to initialize variable to
random value. Using following construct: ${=name} inside requesttemplate
causes flood to create variable 'name', and assign it a value obtained
by calling rand/lrand48/random. Consider a typical scenario, where you
would like to fetch some item (say article) from database using random
index. Here's an example:

responsetemplate="http://www.example.com/getArticle?id={=art_id}

The problem is that range for random values is 0 - RAND_MAX (which is
2147483647 on my system). Not every database out there can be proud to
have (calls random...) 27667 articles handy. So we need fixed range for
random variables, which is what I have already written. The problem is
how we integrate this into flood.

Right now the range can be specified as:

   5:24
 -12:79
    :41   (means 0:41)
 123:     (means 123:RAND_MAX)

Natural choice would be to use following construct for assigning fixed
range:

${5:24=name}

This just extends existing concept, but also look's kinda odd. I would
like to replace it with more general syntax:

${name=rand(5:24)}

Is it okay with everybody? Please speak up if that violates anything.

regards
--
Jacek Prucia

Mime
View raw message