anchor.diff:      FirstDelay = randoms:rand_uniform(1, get_bench_interval() + 1),
       msg_delay:send_local(FirstDelay, self(), {bench}),
       msg_delay:send_local(get_gather_interval(), self(), {propagate}),
  -    {0, rrd:create(get_gather_interval() * 1000000, 60, {timing, us})}.
  +    Now = os:timestamp(),
  +    #state{perf_rr = rrd:create(get_gather_interval() * 1000000, 60, {timing, us}, Now),
  +           perf_lh = rrd:create(get_gather_interval() * 1000000, 60, {timing, count}, Now)}.
   
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   % Miscellaneous
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   
  --spec timing_update_fun(Time::rrd:internal_time(), Old::rrd:timing_type(T) | undefined, New::rrd:timing_type(T))
  -        -> rrd:timing_type(T) when is_subtype(T, number()).
  +-spec timing_update_fun(Time::rrd:internal_time(), Old::rrd:timing_type(T) | undefined, New::rrd:timing_type(T) | undefined)
  +        -> rrd:timing_type(T) | undefined when is_subtype(T, number()).
   timing_update_fun(_Time, undefined, New) ->
       New;
  +timing_update_fun(_Time, Old, undefined) ->
  +    Old;
   timing_update_fun(_Time, {Sum, Sum2, Count, Min, Max, Hist},
                     {NewSum, NewSum2, NewCount, NewMin, NewMax, NewHist}) ->
       NewHist2 = lists:foldl(fun({V, C}, Acc) ->
  
positive.code: 
  -behaviour(gen_component).
  
  -include("scalaris.hrl").
  
  % monitor process functions
  -export([start_link/1, init/1, on/2, check_config/0]).
  
  -type state() :: {Round::non_neg_integer(), Stats::rrd:rrd()}.
  -type message() ::
      {bench} |
      {propagate} |
      {get_node_details_response, node_details:node_details()} |
      {gather_stats, SourcePid::comm:mypid(), Round::pos_integer()} |
      {{get_rrd_response, Process::atom(), Key::string(), DB::rrd:rrd() | undefined}, {SourcePid::comm:mypid(), Round::pos_integer()}} |
      {gather_stats_response, Round::pos_integer(), Data::rrd:timing_type(number())} |
      {report_value, Round::pos_integer(), Stats::rrd:rrd()}.
  
  -spec run_bench() -> ok.
  run_bench() ->
  
negative.code:     {Sum + NewSum, Sum2 + NewSum2, Count + NewCount,
       erlang:min(Min, NewMin), erlang:max(Max, NewMax), NewHist2}.
  
  -spec check_timeslots(state()) -> state().
  check_timeslots(State = #state{perf_rr = PerfRR, perf_lh = PerfLH}) ->
      State#state{perf_rr = rrd:check_timeslot_now(PerfRR),
                  perf_lh = rrd:check_timeslot_now(PerfLH)}.
  
  -spec broadcast_values(OldState::state(), NewState::state()) -> ok.
  broadcast_values(OldState, NewState) ->
      % broadcast the latest value only if a new time slot was started
      OldPerfRR = OldState#state.perf_rr,
      NewPerfRR = NewState#state.perf_rr,
      OldPerfLH = OldState#state.perf_lh,
      NewPerfLH = NewState#state.perf_lh,
      case rrd:get_slot_start(0, OldPerfRR) =/= rrd:get_slot_start(0, NewPerfRR) orelse
               rrd:get_slot_start(0, OldPerfLH) =/= rrd:get_slot_start(0, NewPerfLH) of
          true -> % new slot -> broadcast latest values only:
              SendState = reduce_timeslots(1, OldState),
              Msg = {send_to_group_member, monitor_perf, {report_value, SendState}},
              bulkowner:issue_bulk_owner(intervals:all(), Msg);
          _ -> ok %nothing to do
      end.
  
  -spec reduce_timeslots(N::pos_integer(), State::state()) -> state().
  reduce_timeslots(N, State) ->
      State#state{perf_rr = rrd:reduce_timeslots(N, State#state.perf_rr),
                  perf_lh = rrd:reduce_timeslots(N, State#state.perf_lh)}.
  
  -spec integrate_values(OtherState::state(), MyState::state()) -> state().
  integrate_values(OtherState, MyState) ->
      MyPerfRR1 = integrate_value(OtherState#state.perf_rr, MyState#state.perf_rr),
      MyPerfLH1 = integrate_value(OtherState#state.perf_lh, MyState#state.perf_lh),
      MyState#state{round = OtherState#state.round,
                    perf_rr = MyPerfRR1, perf_lh = MyPerfLH1}.
  
  -spec integrate_value(OtherDB::rrd:rrd(), MyDB::rrd:rrd()) -> rrd:rrd().
  integrate_value(OtherDB, MyDB) ->
      DataL = rrd:dump_with(OtherDB, fun(_DB, _From, _To, X) -> X end),
      case DataL of
          [Data] -> 
              Time = rrd:get_current_time(OtherDB),
              rrd:add_with(Time, Data, MyDB, fun timing_update_fun/3);
          []     -> MyDB
      end.
  
  %% @doc Checks whether the node is the current leader.
  