anchor.diff:  %%------------------------------------------------------------------------------------------------
   create_pubsub_node(Client, Settings) ->
       ReqId = iq_id(create, Client),
  +    iq_metrics:request(node_creation, ReqId),
       Request = publish_pubsub_stanza(Client, ReqId, #xmlel{name = <<"nothing">>}),
       %Request = escalus_pubsub_stanza:create_node(Client, ReqId, ?NODE),
       escalus:send(Client, Request),
   
  -    {CreateNodeTime, CreateNodeResult} = timer:tc(
  -        fun() ->
  -            catch escalus:wait_for_stanza(Client, get_parameter(iq_timeout, Settings))
  -        end),
  +    CreateNodeResult = (catch escalus:wait_for_stanza(Client, get_parameter(iq_timeout, Settings))),
   
       case {escalus_pred:is_iq_result(Request, CreateNodeResult), CreateNodeResult} of
           {true, _} ->
               lager:debug("node creation ~p (~p)", [?NODE, self()]),
  -            amoc_metrics:update_counter(node_creation_success, 1),
  -            amoc_metrics:update_time(node_creation, CreateNodeTime);
  +            iq_metrics:response(ReqId, result);
           {false, {'EXIT', {timeout_when_waiting_for_stanza, _}}} ->
  -            amoc_metrics:update_counter(node_creation_timeout, 1),
  +            iq_metrics:timeout(ReqId, delete),
               lager:error("Timeout creating node: ~p", [CreateNodeResult]),
               exit(node_creation_timeout);
           {false, _} ->
  -            amoc_metrics:update_counter(node_creation_failure, 1),
  +            iq_metrics:response(ReqId, error),
               lager:error("Error creating node: ~p", [CreateNodeResult]),
               exit(node_creation_failed)
       end.
  
positive.code:     start_user(Client, Settings).
  
  init_metrics() ->
      Counters = [message,
                  %% node counters
                  node_creation_failure, node_creation_success, node_creation_timeout,
                  %% publication counters
                  publication_query, publication_result, publication_error,
                  publication_success, publication_timeout],
      Times = [node_creation, publication, message_ttd],
      [amoc_metrics:init(counters, Metric) || Metric <- Counters],
      [amoc_metrics:init(times, Metric) || Metric <- Times].
  
  
negative.code:     erlang:monitor(process, Client#client.rcv_pid),
      escalus_tcp:set_active(Client#client.rcv_pid, true),
      send_presence_with_caps(Client),
      user_loop(Settings, Client).
  
  create_new_node(Client, Settings) ->
      amoc_throttle:send_and_wait(?NODE_CREATION_THROTTLING, create_node),
      create_pubsub_node(Client, Settings),
      amoc_coordinator:add(?MODULE, Client).
  
  user_loop(Settings, Client) ->
      receive
          {stanza, _, #xmlel{name = <<"message">>} = Stanza, #{recv_timestamp := TimeStamp}} ->
              process_msg(Stanza, TimeStamp),
              user_loop(Settings, Client);
          {stanza, _, #xmlel{name = <<"iq">>} = Stanza, _} ->
              process_iq(Client, Stanza),
              user_loop(Settings, Client);
          {stanza, _, #xmlel{name = <<"presence">>} = Stanza, _} ->
              process_presence(Client, Stanza),
              user_loop(Settings, Client);
          publish_item ->
              IqTimeout = get_parameter(iq_timeout, Settings),
              Id = publish_pubsub_item(Client, Settings),
              iq_metrics:request(publication, Id, IqTimeout),
              user_loop(Settings, Client);
          {'DOWN', _, process, Pid, Info} when Pid =:= Client#client.rcv_pid ->
              lager:error("TCP connection process ~p down: ~p", [Pid, Info]);
          Msg ->
              lager:error("unexpected message ~p", [Msg])
      end.
  
  schedule_publishing(Pid) ->
      amoc_throttle:send(?PUBLICATION_THROTTLING, Pid, publish_item).
  