anchor.diff:  
   % internal API for the monitor process
   -export([get_slot_start/2, reduce_timeslots/2, add_nonexisting_timeslots/2,
  -         get_type/1, get_slot_length/1, get_current_time/1, get_value/2,
  +         get_type/1, get_slot_length/1, get_current_time/1,
  +         get_value/2, get_value_by_offset/2,
            add_with/4, timing_with_hist_merge_fun/3]).
   
   % misc
  
positive.code:     CurrentSlot = is_current_slot(Time, CurrentTime, StepSize),
      FutureSlot = is_future_slot(Time, CurrentTime, StepSize),
      {CurrentSlot, FutureSlot}.
  
  -spec dump_internal(rrd(), CurrentIdx::non_neg_integer(), EndIdx::non_neg_integer(),
                      CurrentTime::internal_time(), Rest::[T],
  
negative.code:     dump_internal2(DB, EndIndex, CurrentTime, Rest, FunExist, FunNotExist);
  dump_internal(DB, IndexToFetch, EndIndex, CurrentTime, Rest, FunExist, FunNotExist) ->
      NewRest = dump_internal2(DB, IndexToFetch, CurrentTime, Rest, FunExist, FunNotExist),
      dump_internal(DB, (IndexToFetch + 1) rem DB#rrd.count, EndIndex,
                    CurrentTime + DB#rrd.slot_length, NewRest, FunExist, FunNotExist).
  
  dump_internal2(DB, CurrentIndex, CurrentTime, Rest, FunExist, FunNotExist) ->
      From = CurrentTime,
      To = CurrentTime + DB#rrd.slot_length,
      case array:get(CurrentIndex, DB#rrd.data) of
          undefined -> case FunNotExist(DB, From, To) of
                           ignore -> Rest;
                           {keep, X} -> [X | Rest]
  