anchor.diff:  %% Licensed under the Apache License, Version 2.0 (see LICENSE file)
   %%
   %% In this scenarion users are sending message to its neighbours
  -%% (users wiht lower and grater idea defined by NUMBER_OF_*_NEIGHBOURS values)
  -%% Messages will be send NUMBER_OF_SEND_MESSAGE_REPEATS to every selected neighbour
  +%% (users wiht lower and grater id defined by NUMBER_OF_*_NEIGHBOURS values)
  +%% Messages will be sent NUMBER_OF_SEND_MESSAGE_REPEATS to every selected neighbour
   %% after every message given the script will wait SLEEP_TIME_AFTER_EVERY_MESSAGE ms
  -%% Every CHECKER_SESSIONS_INDICATOR is a checker session which just measures message TTD
  +%% Message TTD is calculated by the `received_stanza_handler`.
   %%
   %%==============================================================================
   -module(mongoose_docker_one_to_one).
   
   -include_lib("exml/include/exml.hrl").
   
  --define(CHECKER_SESSIONS_INDICATOR, 10). %% How often a checker session should be generated
  +-define(HOST, <<"localhost">>). %% The virtual host served by the server
   -define(SLEEP_TIME_AFTER_SCENARIO, 10000). %% wait 10s after scenario before disconnecting
  --define(NUMBER_OF_PREV_NEIGHBOURS, 4).
  --define(NUMBER_OF_NEXT_NEIGHBOURS, 4).
  --define(NUMBER_OF_SEND_MESSAGE_REPEATS, 73).
  --define(SLEEP_TIME_AFTER_EVERY_MESSAGE, 20000).
  +-required_variable({'NUMBER_OF_PREV_NEIGHBOURS', <<"Number of users before current one to use."/utf8>>}).
  +-required_variable({'NUMBER_OF_NEXT_NEIGHBOURS',<<"Number of users after current one to use."/utf8>>}).
  +-required_variable({'NUMBER_OF_SEND_MESSAGE_REPEATS', <<"Number of send message (to all neighours) repeats"/utf8>>}).
  +-required_variable({'SLEEP_TIME_AFTER_EVERY_MESSAGE', <<"Wait time between sent messages (in seconds)"/utf8>>}).
   
   -behaviour(amoc_scenario).
   
  
positive.code:     [{socket_opts, socket_opts()}],
      {ok, Client, _} = amoc_xmpp:connect_or_exit(MyId, ExtraProps),
  
      IsChecker = MyId rem ?CHECKER_SESSIONS_INDICATOR == 0,
      do(IsChecker, MyId, Client),
  
      timer:sleep(?SLEEP_TIME_AFTER_SCENARIO),
      escalus_session:send_presence_unavailable(Client),
      escalus_connection:stop(Client).
  
  -spec do(boolean(), amoc_scenario:user_id(), escalus:client()) -> any().
  do(false, MyId, Client) ->
      escalus_connection:set_filter_predicate(Client, none),
  
      escalus_session:send_presence_available(Client),
      timer:sleep(5000),
  
      NeighbourIds = lists:delete(MyId, lists:seq(max(1,MyId-?NUMBER_OF_PREV_NEIGHBOURS),
                                                  MyId+?NUMBER_OF_NEXT_NEIGHBOURS)),
      send_messages_many_times(Client, ?SLEEP_TIME_AFTER_EVERY_MESSAGE, NeighbourIds);
  do(_Other, _MyId, Client) ->
      lager:info("checker"),
      escalus_session:send_presence_available(Client),
      escalus_connection:wait_forever(Client).
  
  -spec send_messages_many_times(escalus:client(), timeout(), [amoc_scenario:user_id()]) -> ok.
  send_messages_many_times(Client, MessageInterval, NeighbourIds) ->
      S = fun(_) ->
                  send_messages_to_neighbors(Client, NeighbourIds, MessageInterval)
          end,
      lists:foreach(S, lists:seq(1, ?NUMBER_OF_SEND_MESSAGE_REPEATS)).
  
  
  -spec send_messages_to_neighbors(escalus:client(), [amoc_scenario:user_id()], timeout()) -> list().
  
negative.code:     Body = <<"hello sir, you are a gentelman and a scholar.">>,
      MsgIn = escalus_stanza:chat_to_with_id_and_timestamp(amoc_xmpp_users:make_jid(ToId), Body),
      escalus_connection:send(Client, MsgIn),
      escalus_connection:wait(Client, SleepTime).
  
  -spec send_and_recv_escalus_handlers() -> [{atom(), any()}].
  send_and_recv_escalus_handlers() ->
  