anchor.diff:  get_lb_module() ->
       config:read(lb_active_module).
   
  -%% TODO!
   -spec collect_stats() -> boolean().
   collect_stats() ->
  -    Metrics = [cpu, mem],
  +    Metrics = [cpu, mem], %% TODO
       lists:member(config:read(lb_active_load_metric), Metrics).
   
   -compile({inline, [monitor_db/0]}).
   -spec monitor_db() -> boolean().
   monitor_db() ->
       is_enabled() andalso config:read(lb_active_db_monitor) =/= none.
  +
  +-spec get_pending_op() -> undefined | lb_op().
  +get_pending_op() ->
  +    erlang:get(pending_op).
  +
  +-spec set_pending_op(undefined | lb_op()) -> ok.
  +set_pending_op(Op) ->
  +    erlang:put(pending_op, Op),
  +    ok.
  +
  +-spec op_pending() -> boolean().
  +op_pending() ->
  +    case erlang:get(pending_op) of
  +        undefined -> false;
  +        OtherOp ->
  +            case old_op(OtherOp) of
  +                false -> true;
  +                true -> %% remove old op
  +                    ?TRACE("Removing old op ~p~n", [OtherOp]),
  +                    erlang:erase(pending_op),
  +                    false
  +            end
  +    end.
  +
  +-spec old_op(lb_op()) -> boolean().
  +old_op(Op) ->
  +    Threshold = config:read(lb_active_wait_for_pending_ops),
  +    timer:now_diff(os:timestamp(), Op#lb_op.time) div 1000 > Threshold.
  +
  +-spec old_data(lb_op()) -> boolean().
  +old_data(Op) ->
  +    LastBalanceTime = erlang:get(time_last_balance),
  +    DataTime = Op#lb_op.data_time,
  +    timer:now_diff(LastBalanceTime, DataTime) > 0.
  +
  +-spec get_time_last_balance() -> erlang:timestamp().
  +get_time_last_balance() ->
  +    erlang:get(time_last_balance).
  +
  +-spec set_time_last_balance() -> ok.
  +set_time_last_balance() ->
  +    erlang:put(time_last_balance, os:timestamp()), ok.
  +
  +-spec set_last_db_monitor_init() -> ok.
  +set_last_db_monitor_init() ->
  +    erlang:put(last_db_monitor_init, os:timestamp()), ok.
  +
  +-spec get_last_db_monitor_init() -> erlang:timestamp().
  +get_last_db_monitor_init() ->
  +    erlang:get(last_db_monitor_init).
  +
  +-spec gossip_available(options()) -> boolean().
  +gossip_available(Options) ->
  +    proplists:is_defined(dht_size, Options) andalso
  +        proplists:is_defined(avg, Options) andalso
  +        proplists:is_defined(stddev, Options).
  +
  +-spec is_simulation(options()) -> boolean().
  +is_simulation(Options) ->
  +    proplists:is_defined(simulate, Options).
   
   -spec trigger(atom()) -> ok.
   trigger(Trigger) ->
  
positive.code:                                 %% TODO fall back in a more clever way / abort lb request
                                  failed ->
                                      ?TRACE("get_request_histogram failed~n", []),
                                      %% TODO what to do now?
                                      dht_node_state:get_split_key(DhtState, From, To, 1, Direction);
                                  Val -> Val
                              end
  
negative.code:                 items -> items;
                  Val -> util:round(Val, 2)
              end,
      ?TRACE("Load: ~p~n", [Value]),
      Value.
  
  -spec get_load_metric(load_metric()) -> unknown | items | number(). %% TODO unknwon shouldn't happen here, in theory it can TODO
  get_load_metric(Metric) ->
  