anchor.diff:  -module(statser_listener_udp).
   
   -behaviour(gen_server).
  +
  +-ifdef(TEST).
  +-include_lib("eunit/include/eunit.hrl").
  +-endif.
   
   %% API
   -export([start_link/1,
  
positive.code:     GlobalPrefix = <<"stats.">>,
      Metric = <<GlobalPrefix/binary, Key/binary>>,
      gen_server:cast(statser_router, {line, Metric, Value, TS}).
  
  
  handle(Packet, State) ->
  
negative.code:         {ok, Val} -> {ok, Mod, Val};
          error -> error
      end.
  
  
  %%
  %% TESTS
  %%
  
  -ifdef(TEST).
  
  calculate_timer_test_() ->
      [?_assertEqual(null, calculate_timer([], 0)),
       ?_assertEqual({0, 100, [0, 100], [0, 10000], 100, 10000}, calculate_timer([100, 0], 2)),
       ?_assertEqual({1, 3, [1, 3, 6], [1, 5, 14], 6, 14}, calculate_timer([1, 3, 2], 3))
      ].
  
  -endif.
  