Module erlperf

Application API.

Copyright © (C) 2019-2022, Maxim Fedorov

Description

Application API. Benchmark/squeeze implementation.

Data Types

code()

code() = erlperf_job:code_map() | erlperf_job:callable()

concurrency_result()

concurrency_result() = {QPS::non_neg_integer(), Concurrency::non_neg_integer()}

concurrency_test()

concurrency_test() = #{threshold => pos_integer(), min => pos_integer(), max => pos_integer()}

concurrency_test_result()

concurrency_test_result() = concurrency_result() | {Max::concurrency_result(), [concurrency_result()]}

isolation()

isolation() = #{host => string()}

run_options()

run_options() = #{concurrency => pos_integer(), sample_duration => pos_integer() | undefined, warmup => non_neg_integer(), samples => pos_integer(), cv => float(), report => extended, isolation => isolation()}

run_result()

run_result() = non_neg_integer() | [non_neg_integer()]

Function Index

benchmark/3 Generic execution engine.
compare/2 Comparison run: starts several jobs and measures throughput for all of them at the same time.
record/4 Records call trace, so it could be used to benchmark later.
run/1Simple case.
run/2 Single throughput measurement cycle.
run/3 Concurrency measurement run.
start/2 Starts a new continuously running job with the specified concurrency.
time/2 Low-overhead benchmarking, runs the code Count times and returns time in microseconds it took to execute the code.

Function Details

benchmark/3

benchmark(Codes, Options, ConOpts) -> any()

Generic execution engine. Supply multiple code versions, run options and either undefined for usual benchmarking, or squeeze mode settings for concurrency test.

compare/2

compare(Codes::[code()], RunOptions::run_options()) -> [run_result()]

Comparison run: starts several jobs and measures throughput for all of them at the same time. All job options are honoured, and if there is isolation applied, every job runs its own node.

record/4

record(Module::module(), Function::atom(), Arity::non_neg_integer(), TimeMs::pos_integer()) -> [[{module(), atom(), [term()]}]]

Records call trace, so it could be used to benchmark later.

run/1

run(Code::code()) -> non_neg_integer()

Simple case. Runs a single benchmark, and returns a steady QPS number. Job specification may include suite & worker init parts, suite cleanup, worker code, job name and identifier (id).

run/2

run(Code::code(), RunOptions::run_options()) -> run_result()

Single throughput measurement cycle. Additional options are applied.

run/3

run(Module::code() | module(), Function::run_options() | atom(), Args::concurrency_test() | [term()]) -> run_result() | concurrency_test_result()

Concurrency measurement run.

start/2

start(Code::code(), Concurrency::non_neg_integer()) -> pid()

Starts a new continuously running job with the specified concurrency. Requires erlperf application to be started.

time/2

time(Code::code(), Count::non_neg_integer()) -> TimeUs::non_neg_integer()

Low-overhead benchmarking, runs the code Count times and returns time in microseconds it took to execute the code.


Generated by EDoc