App-livehttperf
view release on metacpan or search on metacpan
lib/App/livehttperf.pm view on Meta::CPAN
};
}
}
$OPTS{verbosity} = 0 if $OPTS{quiet};
$OPTS{input} = '-' unless $OPTS{input};
%ua_opts = (
max_redirect => 0,
timeout => $OPTS{timeout},
keep_alive => 0,
);
if ( $OPTS{concurrency_max} && $OPTS{concurrency_step} ) {
push @concurrency, 1
unless $OPTS{concurrency_step} == 1;
for ( my $c = $OPTS{concurrency_step}; $c <= $OPTS{concurrency_max}; $c += $OPTS{concurrency_step} ) {
push @concurrency, $c;
}
push @concurrency, $OPTS{concurrency_max}
lib/App/livehttperf.pm view on Meta::CPAN
# status line is parsed up to \n by HTTP::Response->parse()
my $res_hdrs = "$l\n";
RES: while( $l = $fh[++$i] ) {
last RES if $l =~ /^\-{58}/;
unless ( $OPTS{reuse_cookies} ) {
next if $l =~ /^Set-Cookie/i;
}
$res_hdrs .= $l;
}
$res = HTTP::Response->parse($res_hdrs);
unless ( $ua_opts{keep_alive} ) {
if ( my $ka = $res->header('Keep-Alive') ) {
my ($max) = $ka =~ /max=(\d+)/;
$ua_opts{keep_alive} = $max || 100;
}
}
last RRB;
}
}
if ( $req ) {
if ( $OPTS{use_delay} ) {
if ( @recs > 0 ) {
my $prev_date = $recs[-1]->{res}->headers->date;
( run in 0.647 second using v1.01-cache-2.11-cpan-df04353d9ac )