anchor.diff:  process_presence(Client, Stanza) ->
       case exml_query:attr(Stanza, <<"type">>) of
           <<"subscribe">> ->
  -            lager:debug("presence subscribe stanza ~p", [Stanza]),
               From = exml_query:attr(Stanza, <<"from">>),
               send_presence(Client, <<"subscribed">>, From);
           _ ->
               ok %%it's ok to just ignore other presence notifications
       end.
   
  -process_iq(Client, #xmlel{name = <<"iq">>} = Stanza, TS, Requests, Settings) ->
  +process_iq(Client, #xmlel{name = <<"iq">>} = Stanza) ->
       Id = exml_query:attr(Stanza, <<"id">>),
       Type = exml_query:attr(Stanza, <<"type">>),
       NS = exml_query:path(Stanza, [{element, <<"query">>}, {attr, <<"xmlns">>}]),
  -    case {Type, NS, Id, maps:get(Id, Requests, undefined)} of
  -        {<<"get">>, ?NS_DISCO_INFO, _, undefined} ->
  +    case {Type, NS, Id} of
  +        {<<"get">>, ?NS_DISCO_INFO, _} ->
               handle_disco_query(Client, Stanza);
  -        {<<"set">>, ?NS_ROSTER, _, undefined} ->
  +        {<<"set">>, ?NS_ROSTER, _} ->
               ok; %%it's ok to just ignore roster pushes
  -        {_, undefined, <<"publish", _/binary>>, undefined} ->
  -            lager:warning("unknown publish iq ~p", [Stanza]);
  -        {_, undefined, <<"publish", _/binary>>, {Tag, ReqTS}} ->
  -            handle_publish_resp(Stanza, {Tag, TS - ReqTS}, Settings);
  +        {_, undefined, <<"publish", _/binary>>} ->
  +            handle_publish_resp(Stanza,  Id);
           _ ->
               lager:warning("unexpected iq ~p", [Stanza])
  -    end,
  -    maps:remove(Id, Requests).
  -
  -handle_publish_resp(PublishResult, {Tag, PublishTime}, Settings) ->
  -    IqTimeout = get_parameter(iq_timeout, Settings),
  +    end.
  +
  +handle_publish_resp(PublishResult, Id) ->
       case escalus_pred:is_iq_result(PublishResult) of
           true ->
  -            lager:debug("publish time ~p", [PublishTime]),
  -            amoc_metrics:update_counter(publication_result, 1),
  -            amoc_metrics:update_time(publication, PublishTime),
  -            case Tag of
  -                new when IqTimeout * 1000 > PublishTime ->
  -                    amoc_metrics:update_counter(publication_success, 1);
  -                new ->
  -                    amoc_metrics:update_counter(publication_timeout, 1);
  -                timeout -> ok %% do nothing, it's already reported as timeout
  -            end;
  +%%            lager:debug("publish time ~p", [PublishTime]),
  +            iq_metrics:response(Id, result);
           _ ->
  -            amoc_metrics:update_counter(publication_error, 1),
  +            iq_metrics:response(Id, error),
               lager:error("Error publishing failed: ~p", [PublishResult]),
               exit(publication_failed)
       end.
  
positive.code:     Content = item_content(PayloadSize),
      Request = publish_pubsub_stanza(Client, Id, Content),
      escalus:send(Client, Request),
      {os:system_time(microsecond), Id}.
  
  publish_pubsub_stanza(Client, Id, Content) ->
      ItemId = <<"current">>,
  
negative.code:     start_user(Client, Settings).
  
  init_metrics() ->
      iq_metrics:start([node_creation, publication]),
      Counters = [message],
      Times = [message_ttd],
      [amoc_metrics:init(counters, Metric) || Metric <- Counters],
      [amoc_metrics:init(times, Metric) || Metric <- Times].
  
  