- COPYRIGHT AND LICENSE
- SEE ALSO
App::plackbench - programmatic interface to plackbench
See plackbench for the command line tool.
my $bench = App::plackbench->new( psgi_path => $psgi_path, count => 5, uri => '/some/path', ); my $stats = $bench->run(); printf("Averaged %8.3f seconds over %d requests\n", $stats->mean(), $stats->count());
Class for executing requests on a Plack application and recording stats.
Number of times to execute the request. Defaults to 1.
If true, an initial request will be made which won't be included in the stats. Defaults to false.
An arrayref of subroutine references to do any preprocessing of the request. Each subroutine reference will be called in order (though you shouldn't rely on that) and passed a reference to the HTTP::Request object.
Each sub will be called once for every unique request. Under a normal GET request, there will only be one unique request. However if "post_data" is being used there will be one unique request for request body.
The return value from the subs is ignored.
An arrayref of request bodies. If set, POST requests will be made instead of GET requests.
If multiple request bodies are set they will be rotated through. This can be useful, for instance, to cycle through possible values for a field.
The path to the Plack application to be tested.
The URI to request on the app.
Returns a new instance of
App::plackbench. Any arguments will be used a attribute settings.
Executes the requests (using the current attribute settings), and returns an App::plackbench::Stats object. Takes no arguments.
Paul Boyd <firstname.lastname@example.org>
This software is copyright (c) 2014 by Paul Boyd.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.