HTTP::LoadGen::Run - HTTP client for HTTP::LoadGen
BEGIN {$ENV{HTTP__LoadGen__Run__dbg}=1} # turn on debugging
use HTTP::LoadGen::Run;
# fetch an URL
$rc=HTTP::LoadGen::Run::run_url $method, $scheme, $host, $port, $uri, $param;
# fetch a list of URLs
HTTP::LoadGen::Run::run_urllist +{times=>10,
before=>sub {...},
after=>sub {...},
InitURLs=>sub {...}};
HTTP::LoadGen::Run implements the HTTP client for HTTP::LoadGen.
performs one HTTP request as specified by the parameters. See URLList in HTTP::LoadGen for more information on the parameters.
Note, predelay and postdelay specifications are evaluated by HTTP::LoadGen::loadgen(). So, they don't have any effect here.
performs a set of HTTP requests one at a time using run_url. %config is a hash that may contain these keys:
The value is an iterator generator as described in InitURLs in HTTP::LoadGen.
This value must be a code reference. There are no predefined iterators here.
an optional code reference called as
$config->{before}->($rq);
before each request. The ReqStart hook in HTTP::LoadGen is implemented this way.
an optional code reference called as
$config->{before}->($rc, $rq);
after each request. The ReqDone hook in HTTP::LoadGen is implemented this way.
All of the following constants are exported by default. See also HTTP::LoadGen.
1)it is permitted to use a kept-alive connection if available
2)it is permitted to keep the connection alive for later usage
3)both of the above
These constants are indices into an array returned by the URL iterator.
0)the HTTP request method, GET, POST, etc.
1)http or https.
2)the hostname or IP address
3)the port number
4)the URI.
5)the $param hash.
These constants are indices into the array returned by run_url.
0)1)2)3)4)5)6)7)8)9)10)11)see "Request descriptor and return element" in HTTP::LoadGen.
Torsten Förtsch, <torsten.foertsch@gmx.net>
Copyright (C) 2010 by Torsten Förtsch
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.