Bencher-Backend

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


        Whether to test participant code once first before benchmarking.

        By default, participant code is run once first for testing (e.g.
        whether it dies or return the correct result) before benchmarking.
        If your code runs for many seconds, you might want to skip this test
        and set this to 0.

    *   tidy => *bool*

        Run perltidy over generated scripts.

    *   with_args_size => *bool*

        Also return memory usage of item's arguments.

        Memory size is measured using Devel::Size.

    *   with_process_size => *bool*

        Also return process size information for each item.

        This is done by dumping each item's code into a temporary file and
        running the file with a new perl interpreter process and measuring
        the process size at the end (so it does not need to load Bencher
        itself or the other items). Currently only works on Linux because
        process size information is retrieved from "/proc/PID/smaps". Not
        all code can work, e.g. if the code tries to access a closure or
        outside data or extra modules (modules not specified in the
        participant or loaded by the code itself). Usually does not make
        sense to use this on external command participants.

    *   with_result_size => *bool*

        Also return memory usage of each item code's result (return value).

        Memory size is measured using Devel::Size.

    Returns an enveloped result (an array).

    First element ($status_code) is an integer containing HTTP-like status
    code (200 means OK, 4xx caller error, 5xx function error). Second
    element ($reason) is a string containing error message, or something
    like "OK" if status is 200. Third element ($payload) is the actual
    result, but usually not present when enveloped result is an error
    response ($status_code is not 2xx). Fourth element (%result_meta) is
    called result metadata and is optional, a hash that contains extra
    information, much like how HTTP response headers provide additional
    metadata.

    Return value: (any)

  chart_result
    Usage:

     chart_result(%args) -> [$status_code, $reason, $payload, \%result_meta]

    Generate chart from the result.

    Will use gnuplot (via Chart::Gnuplot) to generate the chart. Will
    produce ".png" files in the specified directory.

    Currently only results with one or two permutations of different items
    will be chartable.

    Options to customize the look/style of the chart will be added in the
    future.

    This function is not exported by default, but exportable.

    Arguments ('*' denotes required arguments):

    *   envres* => *array*

        Enveloped result from bencher.

    *   output_file* => *str*

        .

    *   overwrite => *bool*

        (No description)

    *   title => *str*

        (No description)

    Returns an enveloped result (an array).

    First element ($status_code) is an integer containing HTTP-like status
    code (200 means OK, 4xx caller error, 5xx function error). Second
    element ($reason) is a string containing error message, or something
    like "OK" if status is 200. Third element ($payload) is the actual
    result, but usually not present when enveloped result is an error
    response ($status_code is not 2xx). Fourth element (%result_meta) is
    called result metadata and is optional, a hash that contains extra
    information, much like how HTTP response headers provide additional
    metadata.

    Return value: (any)

  format_result
    Usage:

     format_result($envres, $formatters, $options, $exclude_formatters) -> [$status_code, $reason, $payload, \%result_meta]

    Format bencher result.

    This function is not exported by default, but exportable.

    Arguments ('*' denotes required arguments):

    *   $envres* => *array*

        Enveloped result from bencher.

    *   $exclude_formatters => *array[str]*

        Exclude Formatters specification.



( run in 0.447 second using v1.01-cache-2.11-cpan-744e820c463 )