AnyEvent-HTTPBenchmark

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	-delete some obsolete things
0.06
	-more help
0.05 
	-adding help
	-try to curve dns caching problem :)
0.04
	-remove the -file param releted code.
	-change the all say to perl due the perl 5.8.x(really because this version is using be RHEL/CentOS )
0.03 
	-adding the command line args. ( -url , -c , -n , -debug , -file, -proxy , useragent ) 
0.02
	-add some stats output + small code refactoring
0.01
	-first public release

LICENSE  view on Meta::CPAN

   covered by this License.

   b) Accompany the object code with a copy of the GNU GPL and this license
   document.

  4. Combined Works.

  You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:

   a) Give prominent notice with each copy of the Combined Work that
   the Library is used in it and that the Library and its use are
   covered by this License.

   b) Accompany the Combined Work with a copy of the GNU GPL and this license
   document.

   c) For a Combined Work that displays copyright notices during

benchmark.pl  view on Meta::CPAN

#!/usr/bin/env perl
use common::sense;     #new features in perl
use Getopt::Long;      # to command line parsing
use AnyEvent::HTTP; # use for http requests and etc. methods
use POSIX; # POSIX related stuff
use Data::Dumper;      # to debug data
use AnyEvent::CacheDNS ':register'; # dns requests caching
my $DEBUG      = 0;        #Debug mode. Default is false (0)
my $verbose    = 0;        #to view the each connection result
my $timeout    = 60;
my $count      = 30000;    #default number of requests
my $concurency = 20;       # default number of parralle requests
my $done       = 0;             #number of done requests
my $url; # the url to test
my $method = 'GET';        #http method
my $proxy;                 # proxy server

benchmark.pl  view on Meta::CPAN

    if (not defined @ARGV)
    {
        print <<HEREDOC;
    AnyEvent::HTTPBenchmark     http://github.com/shafiev/AnyEvent-HTTPBenchmark


        -url                 url to test,
        -number        number of requests,
        -c                    number of parrallel clients
        -verbose        verbose mode
        -debug           debug mode
        -proxy            proxy
        -useragent     useragent string

Example :
    ./benchmark.pl -url http://myfavouritesite.com  -n number_of_requests -c number_of_parrallel clients 
    
 Another example :
    benchmark.pl --url http://example.com -n 100 -c 10 -verbose 3
    

HEREDOC
       exit;
    }

    #get options which ovveride the default values
    my $result = GetOptions(
        "url=s"       => \$url,
        "n=i"         => \$count,
        "c=i"         => \$concurency,
        "verbose=i"  => \$verbose,
        "debug"       => \$DEBUG,
        "proxy=s"     => \$proxy,
        "useragent=s" => \$useragent
    );

    if ($concurency > $count) {
        #the mini hack to avoid stupid cases ;)
        $concurency = $count;
    }

    unless ($url) {



( run in 0.602 second using v1.01-cache-2.11-cpan-49f99fa48dc )