App::BencherUtils - Utilities related to bencher
This document describes version 0.21 of App::BencherUtils (from Perl distribution App-BencherUtils), released on 2017-07-13.
This distribution includes several utilities:
bencher-code
bencher-module-startup-overhead
chart-bencher-result
cleanup-old-bencher-results
format-bencher-result
list-bencher-results
list-bencher-scenario-modules
Usage:
bencher_code(%args) -> [status, msg, result, meta]
Accept a list of codes and perform benchmark.
% bencher-code 'code1' 'code2'
is basically a shortcut for creating a scenario like this:
{ participants => [ {code_template=>'code1'}, {code_template=>'code2'}, ], }
and running that scenario with bencher.
bencher
This function is not exported.
Arguments ('*' denotes required arguments):
codes* => array[str]
startup => bool (default: 0)
Use code_startup mode instead of normal benchmark.
with_process_size => bool
Returns an enveloped result (an array).
First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.
Return value: (any)
bencher_module_startup_overhead(%args) -> [status, msg, result, meta]
Accept a list of module names and perform startup overhead benchmark.
% bencher-module-startup-overhead Mod1 Mod2 Mod3
{ module_startup => 1, participants => [ {module=>"Mod1"}, {module=>"Mod2"}, {module=>"Mod3"}, ], }
modules* => array[perl::modname]
chart_bencher_result(%args) -> [status, msg, result, meta]
Generate chart of bencher result and display it.
json* => str
JSON data.
cleanup_old_bencher_results(%args) -> [status, msg, result, meta]
Delete old results.
By default it will only keep 1 latest result for each scenario for the same CPU and the same module versions.
You can use --dry-run first to see which files would be deleted without actually deleting them.
--dry-run
This function supports dry-run operation.
detail => bool
num_keep => int (default: 0)
Number of old results to keep.
query => array[str]
result_dir* => str
Directory to store results files in.
Special arguments:
-dry_run => bool
Pass -dry_run=>1 to enable simulation mode.
format_bencher_result(%args) -> [status, msg, result, meta]
Format bencher raw/JSON result.
list_bencher_results(%args) -> [status, msg, result, meta]
List results in results directory.
exclude_scenarios => array[str]
fmt => bool
Display each result with bencher-fmt.
include_scenarios => array[str]
latest => bool
module_startup => bool
list_bencher_scenario_modules(%args) -> [status, msg, result, meta]
List Bencher scenario modules.
query => str
Please visit the project's homepage at https://metacpan.org/release/App-BencherUtils.
Source repository is at https://github.com/perlancar/perl-App-BencherUtils.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-BencherUtils
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2017, 2016 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::BencherUtils, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::BencherUtils
CPAN shell
perl -MCPAN -e shell install App::BencherUtils
For more information on module installation, please visit the detailed CPAN module installation guide.