anchor.diff:      Metrics = State#state.metrics,
       lager:debug("instrumentation: handle metrics update - current ~p", [Metrics]),
   
  -    % TODO: handle list values as well
       UpdatedM = maps:fold(fun(K, V, Map) when is_number(V) ->
                                    publish(K, V, Now, Path),
                                    maps:put(K, 0, Map);
  +                            (K, Vs, Map) when is_list(Vs) ->
  +                                 Avg = statser_calc:safe_average(Vs),
  +                                 publish(K, Avg, Now, Path),
  +                                 maps:put(K, [], Map);
                               (_K, _V, Map) -> Map
                            end, Metrics, Metrics),
   
  
positive.code:     Map = increment_metrics(Key, Amount, State#state.metrics),
      {noreply, State#state{metrics=Map}};
  
  handle_cast({append, Key, Value}, State) ->
      Map = append_metrics(Key, Value, State#state.metrics),
      {noreply, State#state{metrics=Map}};
  
  handle_cast(_Msg, State) ->
  
negative.code:     gen_server:cast(?MODULE, {increment, Key, Amount}).
  
  
  record(Key, Value) ->
      gen_server:cast(?MODULE, {record, Key, Value}).
  
  
  %%%===================================================================
  