anchor.diff:  get_current_time(DB) ->
       DB#rrd.current_time.
   
  +%% @doc Gets the value at the given time or 'undefined' if there is no value.
  +-spec get_value(DB::rrd(), Time::util:time() | internal_time()) -> undefined | data_type().
  +get_value(DB, {_, _, _} = Time) ->
  +    get_value(DB, timestamp2us(Time));
  +get_value(DB, InternalTime) when is_integer(InternalTime) ->
  +    CurrentIndex = DB#rrd.current_index,
  +    Count = DB#rrd.count,
  +    EndIndex = (CurrentIndex + 1) rem Count,
  +    get_value_internal(
  +      DB, InternalTime, CurrentIndex, EndIndex, DB#rrd.current_time).
  +
   %% @doc If SlotOffset is 0, gets the current value, otherwise the value in a
   %%      previous slot the given offset away from the current one.
  --spec get_value(DB::rrd(), SlotOffset::non_neg_integer()) -> undefined | data_type().
  -get_value(DB, 0) ->
  +%%      May return 'undefined' if there is no value.
  +-spec get_value_by_offset(DB::rrd(), SlotOffset::non_neg_integer()) -> undefined | data_type().
  +get_value_by_offset(DB, 0) ->
       array:get(DB#rrd.current_index, DB#rrd.data); % minor optimization
  -get_value(DB, SlotOffset) ->
  +get_value_by_offset(DB, SlotOffset) ->
       Index = (DB#rrd.current_index + SlotOffset) rem DB#rrd.count,
       array:get(Index, DB#rrd.data).
   
  
positive.code: 
  % 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,
           add_with/4, timing_with_hist_merge_fun/3]).
  
  % misc
  
negative.code: 
  -spec dump_with(rrd(), dump_fun_existing(T), dump_fun_nonexisting(U)) -> [T | U].
  dump_with(DB, FunExist, FunNotExist) ->
      CurrentIndex = DB#rrd.current_index,
      Count = DB#rrd.count,
      dump_internal(DB, (CurrentIndex + 1) rem Count, CurrentIndex,
                    DB#rrd.current_time - (Count - 1) * DB#rrd.slot_length, [],
                    FunExist, FunNotExist).
  
  %% @doc Merges any value of DB2 which is in the current or a future time slot
  %%      of DB1 into it and returns a new rrd.
  