anchor.diff:      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),
  +    Dict1 = add_to_dict(CBin, [Prefix, <<"mps">>], PPF, Time, P, Dict),
  +    Metrics = do_metrics(Prefix, CBin, PPF, Time, Spec, Dict1),
       metric:mput(Nodes1, Metrics, W),
   
       erlang:send_after(?INTERVAL, self(), tick),
  
positive.code: %% @end
  %%--------------------------------------------------------------------
  init([]) ->
      ets:new(?COUNTERS_MPS, [named_table, set, public, {write_concurrency, true}]),
      {ok, N} = application:get_env(dalmatiner_db, n),
      {ok, W} = application:get_env(dalmatiner_db, w),
      erlang:send_after(?INTERVAL, self(), tick),
      lager:info("[metrics] Initializing metric watcher with N: ~p, W: ~p at an "
                 "interval of ~pms.", [N, W, ?INTERVAL]),
      {ok, #state{n=N, w=W, prefix = list_to_binary(atom_to_list(node()))}}.
  
  
  %%--------------------------------------------------------------------
  
negative.code: a2b(A) ->
      erlang:atom_to_binary(A, utf8).
  
  % build_histogram(Stats, Prefix, PPF, Time, CBin, Acc)
  build_histogram([], _, _, _, _, Acc) ->
      Acc;
  
  build_histogram([{min, V} | H], Prefix, PPF, Time, CBin, Acc) ->
      Acc1 = add_metric(Prefix, CBin, <<"min">>, PPF, Time, round(V), Acc),
      build_histogram(H, Prefix, PPF, Time, CBin, Acc1);
  
  build_histogram([{max, V} | H], Prefix, PPF, Time, CBin, Acc) ->
      Acc1 = add_metric(Prefix, CBin, <<"max">>, PPF, Time, round(V), Acc),
      build_histogram(H, Prefix, PPF, Time, CBin, Acc1);
  
  build_histogram([{arithmetic_mean, V} | H], Prefix, PPF, Time, CBin, Acc) ->
      Acc1 = add_metric(Prefix, CBin, <<"arithmetic_mean">>, PPF, Time, round(V), Acc),
      build_histogram(H, Prefix, PPF, Time, CBin, Acc1);
  
  build_histogram([{geometric_mean, V} | H], Prefix, PPF, Time, CBin, Acc) ->
      Acc1 = add_metric(Prefix, CBin, <<"geometric_mean">>, PPF, Time, round(V), Acc),
      build_histogram(H, Prefix, PPF, Time, CBin, Acc1);
  
  build_histogram([{harmonic_mean, V} | H], Prefix, PPF, Time, CBin, Acc) ->
      Acc1 = add_metric(Prefix, CBin, <<"harmonic_mean">>, PPF, Time, round(V), Acc),
      build_histogram(H, Prefix, PPF, Time, CBin, Acc1);
  
  build_histogram([{median, V} | H], Prefix, PPF, Time, CBin, Acc) ->
      Acc1 = add_metric(Prefix, CBin, <<"median">>, PPF, Time, round(V), Acc),
      build_histogram(H, Prefix, PPF, Time, CBin, Acc1);
  
  build_histogram([{variance, V} | H], Prefix, PPF, Time, CBin, Acc) ->
      Acc1 = add_metric(Prefix, CBin, <<"variance">>, PPF, Time, round(V), Acc),
      build_histogram(H, Prefix, PPF, Time, CBin, Acc1);
  
  build_histogram([{standard_deviation, V} | H], Prefix, PPF, Time, CBin, Acc) ->
      Acc1 = add_metric(Prefix, CBin, <<"standard_deviation">>, PPF, Time, round(V), Acc),
      build_histogram(H, Prefix, PPF, Time, CBin, Acc1);
  
  build_histogram([{skewness, V} | H], Prefix, PPF, Time, CBin, Acc) ->
      Acc1 = add_metric(Prefix, CBin, <<"skewness">>, PPF, Time, round(V), Acc),
      build_histogram(H, Prefix, PPF, Time, CBin, Acc1);
  
  build_histogram([{kurtosis, V} | H], Prefix, PPF, Time, CBin, Acc) ->
      Acc1 = add_metric(Prefix, CBin, <<"kurtosis">>, PPF, Time, round(V), Acc),
      build_histogram(H, Prefix, PPF, Time, CBin, Acc1);
  
  build_histogram([{percentile,
                    [{50, P50}, {75, P75}, {90, P90}, {95, P95}, {99, P99},
                     {999, P999}]} | H], Prefix, PPF, Time, CBin, Acc) ->
      Acc1 = add_metric(Prefix, CBin, <<"p50">>, PPF, Time, round(P50), Acc),
      Acc2 = add_metric(Prefix, CBin, <<"p75">>, PPF, Time, round(P75), Acc1),
      Acc3 = add_metric(Prefix, CBin, <<"p90">>, PPF, Time, round(P90), Acc2),
      Acc4 = add_metric(Prefix, CBin, <<"p95">>, PPF, Time, round(P95), Acc3),
      Acc5 = add_metric(Prefix, CBin, <<"p99">>, PPF, Time, round(P99), Acc4),
      Acc6 = add_metric(Prefix, CBin, <<"p999">>, PPF, Time, round(P999), Acc5),
      build_histogram(H, Prefix, PPF, Time, CBin, Acc6);
  
  build_histogram([{n, V} | H], Prefix, PPF, Time, CBin, Acc) ->
      Acc1 = add_metric(Prefix, CBin, <<"count">>, PPF, Time, V, Acc),
      build_histogram(H, Prefix, PPF, Time, CBin, Acc1);
  
  build_histogram([_ | H], Prefix, PPF, Time, CBin, Acc) ->
      build_histogram(H, Prefix, PPF, Time, CBin, Acc).
  