anchor.diff:  %% Tests
   
   parse_stats_test() ->
  -    Now = now(),
  +    Now = misc:time_to_epoch_ms_int(now()),
       Input =
           [{<<"conn_yields">>,<<"0">>},
            {<<"threads">>,<<"4">>},
  
positive.code: %% API
  -export([start_link/1]).
  
  -record(state, {bucket, counters, count=?LOG_FREQ}).
  
  %% gen_server callbacks
  -export([init/1, handle_call/3, handle_cast/2,
  
negative.code:                  undefined ->
                       lists:duplicate(length([?STAT_COUNTERS]), undefined);
                   _ ->
                       Delta = TS - LastTS,
                       if Delta > 0 ->
                               lists:zipwith(
                                 fun (A, B) ->
                                         Res = (A - B) * 1000 div Delta,
                                         if Res < 0 -> 0;
                                            true -> Res
                                         end
                                 end, Counters, LastCounters);
                          true ->
                               lists:duplicate(length([?STAT_COUNTERS]),
                                               undefined)
                       end
               end,
      {list_to_tuple([stat_entry, TS] ++ Gauges ++ Deltas), Counters}.
  
  