Copyright © (C) 2019, Maxim Fedorov
Behaviours: gen_server.
Authors: Maxim Fedorov (maximfca@gmail.com).
callable() = mfargs() | [mfargs()] | function() | fun((term()) -> term()) | string()
code() = callable() | code_map()
code_map() = #{runner := callable(), init => callable(), init_runner => callable(), done => callable(), initial_concurrency => non_neg_integer(), name => string()}
mfargs() = {module(), atom(), [term()]}
state() = #state{code = code(), init = callable(), done = callable(), init_runner = callable(), runner = callable(), module = module() | [], init_result = term(), init_runner_result = term(), workers = [pid()], cref = atomics:atomics_ref()}
get_counters/1 | Internally used by the monitoring process to access job atomic counter. |
handle_call/3 | |
handle_cast/2 | |
handle_info/2 | |
info/1 | Returns information about currently running job. |
init/1 | |
profile/1 | Runs a single iteration, using fprof profiler. |
profile/3 | Runs a profiler for a selected number of runner iterations. |
set_concurrency/2 | Change concurrency setting for this job. |
start/1 | Starts the benchmark instance using default (ep_job_sup) supervisor. |
start_link/1 | Starts the benchmark instance and links it to caller. |
stop/1 | Stops the benchmark instance (via supervisor). |
terminate/2 |
get_counters(JobId::pid()) -> atomics:atomics_ref()
Internally used by the monitoring process to access job atomic counter.
handle_call(Request::term(), From::{pid(), reference()}, State::state()) -> {reply, term(), state()}
handle_cast(Request::term(), State::state()) -> no_return()
info(JobId::pid()) -> {ok, code(), Concurrency::non_neg_integer()}
Returns information about currently running job. Includes job description, and number of currently running workers.
profile(JobId::pid()) -> term()
Runs a single iteration, using fprof profiler
profile(JobId::pid(), Profiler::fprof, Format::term | binary | string) -> term()
Runs a profiler for a selected number of runner iterations.
set_concurrency(JobId::pid(), Concurrency::non_neg_integer()) -> ok
Change concurrency setting for this job. Does not reset counting.
start(Code::code()) -> {ok, Pid::pid()} | {error, {already_started, pid()}} | {error, Reason::term()}
Starts the benchmark instance using default (ep_job_sup) supervisor.
start_link(Code::code()) -> {ok, Pid::pid()} | {error, {already_started, pid()}} | {error, Reason::term()}
Starts the benchmark instance and links it to caller. Job starts with no workers, use set_concurrency/2 to start some.
stop(JobId::pid()) -> ok
Stops the benchmark instance (via supervisor).
terminate(Reason::term(), State::state()) -> ok
Generated by EDoc