View Source amoc_controller (amoc v3.0.0-rc2)

Summary

Types

amoc_controller is disabled for the master node

Types

-type amoc_status() ::
    idle |
    {running, amoc:scenario(), user_count(), last_user_id()} |
    {terminating, amoc:scenario()} |
    {finished, amoc:scenario()} |
    {error, any()} |
    disabled.
amoc_controller is disabled for the master node
-type handle_call_res() :: ok | {ok, term()} | {error, term()}.
-type interarrival() :: non_neg_integer().
-type last_user_id() :: non_neg_integer().
-type state() :: #state{}.
-type user_count() :: non_neg_integer().

Functions

Link to this function

add_users(StartId, EndId)

View Source
-spec add_users(amoc_scenario:user_id(), amoc_scenario:user_id()) -> ok | {error, term()}.
-spec disable() -> ok | {error, term()}.
-spec get_status() -> amoc_status().
Link to this function

handle_call(Request, From, State)

View Source
-spec handle_call(any(), any(), state()) -> {reply, handle_call_res(), state()}.
-spec handle_cast(any(), state()) -> {noreply, state()}.
-spec handle_info(any(), state()) -> {noreply, state()}.
-spec init([]) -> {ok, state()}.
Link to this function

maybe_update_interarrival_timer(_, _)

View Source
Link to this function

positive_integer(Interarrival)

View Source
-spec positive_integer(any()) -> boolean().
Link to this function

remove_users(Count, ForceRemove)

View Source
-spec remove_users(user_count(), boolean()) -> {ok, user_count()}.
-spec start_link() -> {ok, pid()}.
Link to this function

start_scenario(Scenario, Settings)

View Source
-spec start_scenario(amoc:scenario(), amoc_config:settings()) -> ok | {error, term()}.
-spec stop_scenario() -> ok | {error, term()}.
Link to this function

update_settings(Settings)

View Source
-spec update_settings(amoc_config:settings()) -> ok | {error, term()}.