"Christopher L. Everett" wrote:

> Hello All:
>
> I've written some mod_perl scripts that need testing
> over a million hits or so before I deploy it.  I need
> to prove to myself and my marketing guy that my script
> has certain statistical properties, not the least of
> which is the question of whether my activity logs match
> what actually happened.  Also, there's concurrency
> issues to make sure I've got right.
>

---- snip ----
sorry, but i fail to see why all the trickery is needed.  i assume that
you want to check the content against what is expected, but the banners
are rotating based on some formula.  if you know the formula before hand,
then you know the expected distribution for the banners served.  why not
use something from libwww package to make the requests, md5 the returned
banner relavant data,  return a report which gives the counts for each unique md5.

so in perl pseudocode (untested, no error checking, steps skipped):

for $testnum (0..$number_to_test) {
   $request_url=@bannerurls[rand(@bannerurls)];
   $req = HTTP::Request->new(GET => $request_url);
   $res=$ua->request($req);
   if($res->is_success){
      $dig=md5($res->content);
      $md5{$dig}++;
   }
      $md5{__ERROR__}++;
   }
}

foreach $dig (keys %md5){
   print "the banner with digest=$dig returned $md5{$dig} hits 
for",($md5{$dig}/$number_to_test)*100),"% of total\n";
}

the report should print the distribution requested.  not sure if this can be done 
using ab or the bench
i believe Stas was working on, but libwww is easy to use.  you can even distribute 
this test to a few
of your friends and have them bang on your system from a variety of different places 
to test your
system in a more realistic environment.  then write a program to scour the logs for 
the test period,
and produce the same report from the logs.  they should match almost exactly.  only 
differences in
incompleted log requests etc..

>
>
> 1)  Is there a more elegant way of solving my problem?
> 2)  Has this been done before?
> 2a) If so, is the source for that available?
> 2b) If not, is a tool like this useful for anyone else,
>     so that I should build it better than I would a once-off?
>     What would make it more useful?
>
> Thanks in advance for your help.
>
>   --Christopher Everett
>
> [EMAIL PROTECTED]
> 641-472-4178

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/


Reply via email to