Skip to content

Commit

Permalink
-adding the missing benchmark.pl
Browse files Browse the repository at this point in the history
-rechange the verboser flag to -verbose
-delete some obsolete things
  • Loading branch information
shafiev committed Jun 20, 2010
1 parent 29e9e13 commit e7f2d25
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
7 changes: 6 additions & 1 deletion Changes
@@ -1,10 +1,15 @@
0.07
-adding the missing benchmark.pl
-rechange the verboser flag to -verbose
-delete some obsolete things
0.06
-more help
0.05 0.05
-adding help -adding help
-try to curve dns caching problem :) -try to curve dns caching problem :)
0.04 0.04
-remove the -file param releted code. -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 ) -change the all say to perl due the perl 5.8.x(really because this version is using be RHEL/CentOS )
-
0.03 0.03
-adding the command line args. ( -url , -c , -n , -debug , -file, -proxy , useragent ) -adding the command line args. ( -url , -c , -n , -debug , -file, -proxy , useragent )
0.02 0.02
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST
Expand Up @@ -2,8 +2,9 @@ Changes
MANIFEST MANIFEST
Makefile.PL Makefile.PL
README README
benchmark.pl
lib/AnyEvent/HTTPBenchmark.pm lib/AnyEvent/HTTPBenchmark.pm
t/00-load.t t/00-load.t
t/manifest.t t/manifest.t
t/pod-coverage.t t/pod-coverage.t
t/pod.t t/pod.t
11 changes: 6 additions & 5 deletions benchmark.pl
@@ -1,6 +1,7 @@
#!/usr/bin/env perl #!/usr/bin/env perl
use common::sense; #new features in perl use common::sense; #new features in perl
use Getopt::Long; # to command line parsing use Getopt::Long; # to command line parsing
use AnyEvent::HTTP; # use for http requests and etc. methods
use POSIX; use POSIX;
use Data::Dumper; # to debug data use Data::Dumper; # to debug data
my $DEBUG = 0; #Debug mode. Default is false (0) my $DEBUG = 0; #Debug mode. Default is false (0)
Expand All @@ -13,10 +14,10 @@
my $method = 'GET'; #http method my $method = 'GET'; #http method
my $proxy; # proxy server my $proxy; # proxy server
my $max_recurse = 10; # the default recurse number; my $max_recurse = 10; # the default recurse number;
my $useragent = 'Mozilla/5.0 (compatible; U; AnyEvent::HTTPBenchmark/0.06; +http://github.com/shafiev/AnyEvent-HTTPBenchmark)'; my $useragent = 'Mozilla/5.0 (compatible; U; AnyEvent::HTTPBenchmark/0.07; +http://github.com/shafiev/AnyEvent-HTTPBenchmark)';


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


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


Expand Down Expand Up @@ -63,7 +64,7 @@ sub parse_command_line {
./benchmark.pl -url http://myfavouritesite.com -n number_of_requests -c number_of_parrallel clients ./benchmark.pl -url http://myfavouritesite.com -n number_of_requests -c number_of_parrallel clients
Another example : Another example :
benchmark.pl --url http://example.com -n 100 -c 10 -v benchmark.pl --url http://example.com -n 100 -c 10 -verbose 3
HEREDOC HEREDOC
Expand All @@ -75,7 +76,7 @@ sub parse_command_line {
"url=s" => \$url, "url=s" => \$url,
"n=i" => \$count, "n=i" => \$count,
"c=i" => \$concurency, "c=i" => \$concurency,
"verbose|v+" => \$verbose, "verbose=i" => \$verbose,
"debug" => \$DEBUG, "debug" => \$DEBUG,
"proxy=s" => \$proxy, "proxy=s" => \$proxy,
"useragent=s" => \$useragent "useragent=s" => \$useragent
Expand Down Expand Up @@ -111,7 +112,7 @@ sub add_request {
$done++; $done++;


if ($verbose >= 2) { if ($verbose >= 2) {
print "=========== HTTP RESPONCE ===========\n"; print "=========== HTTP RESPONSE ===========\n";
print @_[0]; print @_[0];
} }


Expand Down
20 changes: 12 additions & 8 deletions lib/AnyEvent/HTTPBenchmark.pm
Expand Up @@ -5,23 +5,25 @@ use strict;


=head1 NAME =head1 NAME
AnyEvent::HTTPBenchmark - The tool to make benchmark good and easy! AnyEvent::HTTPBenchmark - The tool to make http benchmarking good and easy!
=head1 VERSION =head1 VERSION
Version 0.06 Version 0.07
=cut =cut


our $VERSION = '0.06'; our $VERSION = '0.07';




=head1 SYNOPSIS =head1 SYNOPSIS
The apache benchmark (ab) , siege, jmeter and etc, are sometimes awesome to make http-load testing. But if The apache benchmark (ab) , siege, jmeter and etc, are sometimes awesome to make http-load testing. But if
you want make some non-traditional test they are not good decision.This module try to help you in this case. you want make some non-traditional test they are not good decision.This module try to help you in this case.
Currently implemented just test utility , not a library . Currently implemented just test utility , not a library .Be patient ;)
benchmark.pl --url http://example.com -n 100 -c 10 -v benchmark.pl --url http://example.com -n 100 -c 10 -verbose
=head1 EXPORT =head1 EXPORT
Expand All @@ -33,7 +35,8 @@ Currently no export functions are implemented.
=cut =cut


sub function1 { sub make_request {
#not implemented
} }


=head2 function2 =head2 function2
Expand All @@ -55,8 +58,6 @@ the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=AnyEvent-H
automatically be notified of progress on your bug as I make changes. automatically be notified of progress on your bug as I make changes.
=head1 SUPPORT =head1 SUPPORT
You can find documentation for this module with the perldoc command. You can find documentation for this module with the perldoc command.
Expand All @@ -66,6 +67,9 @@ You can find documentation for this module with the perldoc command.
You can also look for information at: You can also look for information at:
L<http://github.com/shafiev/AnyEvent-HTTPBenchmark>
=over 4 =over 4
=item * RT: CPAN's request tracker =item * RT: CPAN's request tracker
Expand Down

0 comments on commit e7f2d25

Please sign in to comment.