Skip to content

Commit

Permalink
Change loginc of processing "--url" argument (make "--url" part optio…
Browse files Browse the repository at this point in the history
…nal)
  • Loading branch information
cub-uanic committed Jun 12, 2010
1 parent 647eebd commit bbc04aa
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions benchmark.pl
Expand Up @@ -4,23 +4,23 @@
use Getopt::Long; # to command line parsing
use POSIX;
use Data::Dumper; # to see the date in debug
my $DEBUG = 0; #Debug mode. Default is false (0)
my $verbose = 0; #to view the each connection result
my $DEBUG = 0; #Debug mode. Default is false (0)
my $verbose = 0; #to view the each connection result
my $timeout = 60;
my $count = 30000; #number of requests
my $concurency = 20; # number of parralle requests
my $count = 30000; #number of requests
my $concurency = 20; # number of parralle requests
my $done = 0;
my $url = 'http://elementa.su/'; # default url to test
my $method = 'GET'; #http method
my $proxy; # proxy server
my $file; #scenario file
my $max_recurse = 10; # the default recurse number;
my $url; # default url to test
my $method = 'GET'; #http method
my $proxy; # proxy server
my $file; #scenario file
my $max_recurse = 10; # the default recurse number;
my $useragent = 'Mozilla/5.0 (compatible; U; AnyEvent::HTTPBenchmark/0.05; +http://github.com/shafiev/AnyEvent-HTTPBenchmark)';

#arrays
my @reqs_time; # the times of requests
my @reqs_time; # the times of requests

parse_command_line(); #parsing the command line arguments
parse_command_line(); #parsing the command line arguments

$AnyEvent::VERBOSE = 10 if $DEBUG;
$AnyEvent::HTTP::MAX_PER_HOST = $concurency;
Expand Down Expand Up @@ -58,6 +58,15 @@ sub parse_command_line {
"proxy=s" => \$proxy,
"useragent=s" => \$useragent
);

unless ($url) {
if (@ARGV) {
$url = shift @ARGV;
}
else {
$url = 'http://elementa.su/';
}
}
}

sub add_request {
Expand Down

0 comments on commit bbc04aa

Please sign in to comment.