Changeset 8c96802 in lab.git
- Timestamp:
- Mar 6, 2014 3:40:19 PM (11 years ago)
- Branches:
- master
- Children:
- 45d3453
- Parents:
- 560dfd2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/httpbench.pl
r560dfd2 r8c96802 7 7 use Getopt::Long qw(:config posix_default no_ignore_case gnu_compat); 8 8 use Parallel::ForkManager; 9 use LWP:: Simple;9 use LWP::UserAgent; 10 10 use Time::HiRes qw(sleep gettimeofday); 11 11 … … 34 34 warn "wait for $wait second between requests\n" if ($wait); 35 35 36 36 my $ua = LWP::UserAgent->new( 37 ssl_opts => { verify_hostname => 0 }, 38 ); 37 39 my $transfer = 0; 38 40 my $pm = Parallel::ForkManager->new($concurrency); … … 58 60 print STDERR "processing $i/$loops loop\r"; 59 61 foreach my $url (@urls) { 60 my $res = get($url) or print STDERR "\nfail: $url"; 61 if ($res) { 62 $transfer += length($res); 62 my $res = $ua->get($url); 63 if ($res->is_success) { 64 $transfer += length($res->content); 65 } 66 else { 67 print STDERR "\nfail: $url"; 63 68 } 64 69 sleep($wait);
Note: See TracChangeset
for help on using the changeset viewer.