anchor.diff:        ((Time div S)*S) =:= FileBase ->
       <<Data:Size/binary, DataRest/binary>> = InData,
       {ok, F1} = write(F, Metric, Time, Data),
  -    do_put(MSet, Metric, R, DataRest, [{FileBase, F1} | First]);
  +    do_put(MSet, Metric, R, DataRest, [{FileBase, F1}, First]);
   
   do_put(MSet = #mset{size=S, dir=D}, Metric,
          [{Time, Size} | R], InData,
  
positive.code:              Seconds2 = T2 / 1000000,
               ?debugFmt("Converted ~p metrics in ~p seconds meaning ~p metrics/second.",
                         [NumPoints, Seconds2, NumPoints/Seconds2]),
               ?assertEqual(lists:reverse(lists:seq(1, NumPoints)), L)
       end}.
  
  add_points(S, Metrics, T, 0) ->
      S1 = lists:foldl(fun(M, SAcc) ->
                               put(SAcc, M, T, [0])
                       end, S, Metrics),
      S1;
  
  add_points(S, Metrics, T, Ps) ->
      S1 = lists:foldl(fun(M, SAcc) ->
                               put(SAcc, M, T, [Ps])
                       end, S, Metrics),
      add_points(S1, Metrics, T+1, Ps-1).
  
  -endif.
  
negative.code:              Dir = "bench",
               T0 = 450,
               NumPoints = 2500,
               Size = 10,
               file:make_dir(Dir),
               {ok, S} = mstore:new(20, 200, Dir),
               Metrics = [list_to_binary(io_lib:format("metric~p", [I])) || I <- lists:seq(0, NumMetrics)],
               {T, S1} = timer:tc(fun () ->
                                          add_points(S, Metrics, Size, T0, NumPoints)
                                  end),
               Seconds = T / 1000000,
               TotalInserts = NumMetrics*NumPoints*Size,
               ?debugFmt("Inserted ~p metrics in batches of ~p, this took ~p seconds meaning ~p metrics/second.",
                         [TotalInserts, Size, Seconds, TotalInserts/Seconds]),
               [M0|_] = Metrics,
               {T1, {ok, R}} = timer:tc(fun() ->
                                                get(S1, M0, T0, NumPoints)
  