anchor.diff:  %% @end
   %%--------------------------------------------------------------------
   
  -handle_info(tick, State = #state{prefix = Prefix, n = N, w = W}) ->
  +handle_info(tick, State = #state{prefix = Prefix, n = N, w = W, ppf = PPF}) ->
       {ok, CBin} = riak_core_ring_manager:get_chash_bin(),
       Nodes = chash:nodes(chashbin:to_chash(CBin)),
       Nodes1 = [{I, riak_core_apl:get_apl(I, N, metric)} || {I, _} <- Nodes],
  
positive.code:     ets:delete_all_objects(?COUNTERS_MPS),
      P = lists:sum([Cnt || {_, Cnt} <- MPS]),
  
      Dict1 = add_to_dict(CBin, [Prefix, <<"mps">>], Time, P, Dict),
      Metrics = do_metrics(Prefix, CBin, Time, Spec, Dict1),
      metric:mput(Nodes1, Metrics, W),
  
      erlang:send_after(?INTERVAL, self(), tick),
  
negative.code:        {five_to_fifteen, FiveToFifteen},
         {one_to_fifteen, OneToFifteen}]}]
          = folsom_metrics:get_metric_value(N),
      Acc1 = add_metric(Prefix1, CBin, [<<"count">>], PPF, Time, Count, Acc),
      Acc2 = add_metric(Prefix1, CBin, [<<"one">>], PPF, Time, One, Acc1),
      Acc3 = add_metric(Prefix1, CBin, [<<"five">>], PPF, Time, Five, Acc2),
      Acc4 = add_metric(Prefix1, CBin, [<<"fifteen">>], PPF, Time, Fifteen, Acc3),
      Acc5 = add_metric(Prefix1, CBin, [<<"day">>], PPF, Time, Day, Acc4),
      Acc6 = add_metric(Prefix1, CBin, [<<"mean">>], PPF, Time, Mean, Acc5),
      Acc7 = add_metric(Prefix1, CBin, [<<"one_to_five">>], PPF, Time, OneToFive, Acc6),
      Acc8 = add_metric(Prefix1, CBin, [<<"five_to_fifteen">>], PPF, Time, FiveToFifteen, Acc7),
      Acc9 = add_metric(Prefix1, CBin, [<<"one_to_fifteen">>], PPF, Time, OneToFifteen, Acc8),
      do_metrics(Prefix, CBin, PPF, Time, Spec, Acc9).
  
  add_metric(Prefix, CBin, Name, PPF, Time, Value, Acc) when is_integer(Value) ->
      add_to_dict(CBin, [Prefix, metric_name(Name)], PPF, Time, Value, Acc);
  
  add_metric(Prefix, CBin, Name, PPF, Time, Value, Acc) when is_float(Value) ->
      Scale = 1000*1000,
      add_to_dict(CBin, [Prefix, metric_name(Name)], PPF, Time, round(Value*Scale), Acc).
  
  add_to_dict(CBin, Metric, PPF, Time, Value, Acc) ->
      Metric1 = dproto:metric_from_list(lists:flatten(Metric)),
      DocIdx = riak_core_util:chash_key({?BUCKET, {Metric, Time div PPF}}),
      {Idx, _} = chashbin:itr_value(chashbin:exact_iterator(DocIdx, CBin)),
      dict:append(Idx, {?BUCKET, Metric1, PPF, Time, mmath_bin:from_list([Value])}, Acc).
  
  timestamp() ->
      {Meg, S, _} = os:timestamp(),
  