anchor.diff:  multibackend_read_block_errors(_, Val) ->
       rbe_val(Val).
   
  -rbe_val(undefined) ->
  -    undefined;
  -rbe_val(Bin) ->
  -    list_to_integer(binary_to_list(Bin)).
  +rbe_val(Bin) when is_binary(Bin) ->
  +    list_to_integer(binary_to_list(Bin));
  +rbe_val(_) ->
  +    undefined.
  +
  +-ifdef(TEST).
  +-define(LEVEL_STATUS(Idx, Val),  [{Idx, [{backend_status, riak_kv_eleveldb_backend,
  +                                                      [{read_block_error, Val}]}]}]).
  +-define(BITCASK_STATUS(Idx),  [{Idx, [{backend_status, riak_kv_bitcask_backend,
  +                                                      []}]}]).
  +-define(MULTI_STATUS(Idx, Val), [{Idx,  [{backend_status, riak_kv_multi_backend, Val}]}]).
  +
  +leveldb_rbe_test_() ->
  +    {foreach,
  +     fun() ->
  +             meck:new(riak_core_ring_manager),
  +             meck:new(riak_core_ring),
  +             meck:new(riak_kv_vnode),
  +             meck:expect(riak_core_ring_manager, get_my_ring, fun() -> {ok, [fake_ring]} end)
  +     end,
  +     fun(_) ->
  +             meck:unload(riak_kv_vnode),
  +             meck:unload(riak_core_ring),
  +             meck:unload(riak_core_ring_manager)
  +     end,
  +     [{"Zero indexes", fun zero_indexes/0},
  +      {"Single index", fun single_index/0},
  +      {"Multi indexes", fun multi_index/0},
  +      {"Bitcask Backend", fun bitcask_backend/0},
  +      {"Multi Backend", fun multi_backend/0}]
  +    }.
  +
  +zero_indexes() ->
  +    meck:expect(riak_core_ring, my_indices, fun(_R) -> [] end),
  +    ?assertEqual(undefined, leveldb_read_block_errors()).
  +
  +single_index() ->
  +    meck:expect(riak_core_ring, my_indices, fun(_R) -> [index1] end),
  +    meck:expect(riak_kv_vnode, vnode_status, fun([{Idx, _}]) -> ?LEVEL_STATUS(Idx, <<"100">>) end),
  +    ?assertEqual(100, leveldb_read_block_errors()),
  +
  +    meck:expect(riak_kv_vnode, vnode_status, fun([{Idx, _}]) -> ?LEVEL_STATUS(Idx, nonsense) end),
  +    ?assertEqual(undefined, leveldb_read_block_errors()).
  +
  +multi_index() ->
  +    meck:expect(riak_core_ring, my_indices, fun(_R) -> [index1, index2, index3] end),
  +    meck:expect(riak_kv_vnode, vnode_status, fun([{Idx, _}]) -> ?LEVEL_STATUS(Idx, <<"100">>) end),
  +    ?assertEqual(100, leveldb_read_block_errors()).
  +
  +bitcask_backend() ->
  +    meck:expect(riak_core_ring, my_indices, fun(_R) -> [index1, index2, index3] end),
  +    meck:expect(riak_kv_vnode, vnode_status, fun([{Idx, _}]) -> ?BITCASK_STATUS(Idx) end),
  +    ?assertEqual(undefined, leveldb_read_block_errors()).
  +
  +multi_backend() ->
  +    meck:expect(riak_core_ring, my_indices, fun(_R) -> [index1, index2, index3] end),
  +    %% some backends, none level
  +    meck:expect(riak_kv_vnode, vnode_status, fun([{Idx, _}]) ->
  +                                                     ?MULTI_STATUS(Idx,
  +                                                              [{name1, [{mod, bitcask}]},
  +                                                               {name2, [{mod, fired_chicked}]}]
  +                                                       )
  +                                             end),
  +    ?assertEqual(undefined, leveldb_read_block_errors()),
  +
  +    %% one or movel leveldb backends (first level answer is returned)
  +    meck:expect(riak_kv_vnode, vnode_status, fun([{Idx, _}]) ->
  +                                                    ?MULTI_STATUS(Idx,
  +                                                              [{name1, [{mod, bitcask}]},
  +                                                               {name2, [{mod, riak_kv_eleveldb_backend},
  +                                                                        {read_block_error, <<"99">>}]},
  +                                                               {name2, [{mod, riak_kv_eleveldb_backend},
  +                                                                        {read_block_error, <<"1000">>}]}]
  +                                                       )
  +                                             end),
  +    ?assertEqual(99, leveldb_read_block_errors()).
  +
  +-endif.
  
positive.code:     %% on this node at random
      %% and ask for it's stats
      {ok, R} = riak_core_ring_manager:get_my_ring(),
      Indices = riak_core_ring:my_indices(R),
      Nth = crypto:rand_uniform(1, length(Indices)),
      Idx = lists:nth(Nth, Indices),
      PList = [{Idx, node()}],
      [{Idx, [Status]}] = riak_kv_vnode:vnode_status(PList),
      leveldb_read_block_errors(Status).
  
  leveldb_read_block_errors({backend_status, riak_kv_eleveldb_backend, Status}) ->
      rbe_val(proplists:get_value(read_block_error, Status));
  
negative.code: -module(riak_kv_stat).
  
  -behaviour(gen_server).
  
  -ifdef(TEST).
  -include_lib("eunit/include/eunit.hrl").
  -endif.
  
  %% API
  -export([start_link/0, get_stats/0,
  