@argh.arg('<STR_LIT>', type=str)<EOL>@argh.arg('<STR_LIT>', '<STR_LIT>', choices=['<STR_LIT>', '<STR_LIT:text>'], default='<STR_LIT:text>')<EOL>@argh.arg('<STR_LIT>',<EOL>choices=['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'],<EOL>action='<STR_LIT>')<EOL>@argh.arg('<STR_LIT>', help='<STR_LIT>')<EOL>@argh.arg('<STR_LIT>', help='<STR_LIT>')<EOL>@argh.arg('<STR_LIT>', choices=('<STR_LIT:all>', '<STR_LIT>'),<EOL>help='<STR_LIT>', default='<STR_LIT>')<EOL>@argh.wrap_errors([KeyboardInterrupt, BrokenPipeError] + clients.client_errors)<EOL>def run_spec(spec,<EOL>benchmark_hosts,<EOL>result_hosts=None,<EOL>output_fmt=None,<EOL>logfile_info=None,<EOL>logfile_result=None,<EOL>action=None,<EOL>fail_if=None,<EOL>sample_mode='<STR_LIT>'):
with Logger(output_fmt=output_fmt,<EOL>logfile_info=logfile_info,<EOL>logfile_result=logfile_result) as log:<EOL><INDENT>do_run_spec(<EOL>spec=spec,<EOL>benchmark_hosts=benchmark_hosts,<EOL>log=log,<EOL>result_hosts=result_hosts,<EOL>action=action,<EOL>fail_if=fail_if,<EOL>sample_mode=sample_mode<EOL>)<EOL><DEDENT>
Run a spec file, executing the statements on the benchmark_hosts.

    Short example of a spec file:

        [setup]
        statement_files = ["sql/create_table.sql"]

            [[setup.data_files]]
            target = "t"
            source = "data/t.json"

        [[queries]]
        statement = "select count(*) from t"
        iterations = 2000
        concurrency = 10

        [teardown]
        statements = ["drop table t"]

    See https://github.com/mfussenegger/cr8/tree/master/specs
    for more examples.

    Args:
        spec: path to a spec file
        benchmark_hosts: hostname[:port] pairs of Crate nodes
        result_hosts: optional hostname[:port] Crate node pairs into which the
            runtime statistics should be inserted.
        output_fmt: output format
        action: Optional action to execute.
            Default is to execute all actions - setup, queries and teardown.
            If present only the specified action will be executed.
            The argument can be provided multiple times to execute more than
            one action.
        fail-if: An expression that causes cr8 to exit with a failure if it
            evaluates to true.
            The expression can contain formatting expressions for:
                - runtime_stats
                - statement
                - meta
                - concurrency
                - bulk_size
            For example:
                --fail-if "{runtime_stats.mean} > 1.34"