anchor.diff:                               {samples_interval, SamplesInterval}
                                | CutSamples]}}]}.
   
  --ifdef(EUNIT). 
  +-ifdef(EUNIT).
  +
  +generate_samples_test() ->
  +    V = generate_samples({1,2,3}, 10),
  +    io:format("V=~p~n", [V]),
  +    ?assertEqual([0,1,39,22,48,48,73,77,74,77,88], V).
  +
  +mk_samples_basic_test() ->
  +    V = mk_samples("now"),
  +    ?assertMatch([{gets, _},
  +                  {misses, _},
  +                  {sets, _},
  +                  {ops, _}],
  +                 V).
  +
  +string_hash_test_() ->
  +    [
  +     ?_assert(string_hash("hello1") /= string_hash("hi")),
  +     ?_assert(string_hash("hi") == ($h*31+$i))
  +    ].
   
   build_bucket_stats_response_cutting_1_test() ->
       Now = 1259747673659,
  
positive.code:     {MegaSec, Sec, Millis} = erlang:now(),
      (MegaSec * 1000000 + Sec) * 1000 + Millis.
  
  build_bucket_stats_response(_Id, Params, Now) ->
      Samples = [{gets, [25, 10, 5, 46, 100, 74]},
                 {misses, [100, 74, 25, 10, 5, 46]},
                 {sets, [74, 25, 10, 5, 46, 100]},
                 {ops, [10, 5, 46, 100, 74, 25]}],
      SamplesSize = 6,
      OpsPerSecondZoom = proplists:get_value("opspersecond_zoom", Params),
      SamplesInterval = case OpsPerSecondZoom of
                            "now" -> 1;
                            "24hr" -> 86400/SamplesSize;
  
negative.code:                            {ops, [_]}]},
                   Ops).
  
  debugger_apply(Fun, Args) ->
      i:im(),
      {module, _} = i:ii(?MODULE),
      i:iaa([break]),
      ok = i:ib(?MODULE, Fun, length(Args)),
      apply(?MODULE, Fun, Args).
  
  test_under_debugger() ->
      i:im(),
      {module, _} = i:ii(?MODULE),
      i:iaa([init]),
      eunit:test({spawn, {timeout, infinity, {module, ?MODULE}}}, [verbose]).
  
  -endif.
  
  