anchor.diff:      end.
   
   grab_stats(PrevCounters, TSDiff) ->
  -    {StatsGauges, StatsCounters0} = massage_stats(get_stats(), [], []),
  +    {StatsGauges, StatsCounters0, Status} = massage_stats(get_stats(), [], [], []),
       StatsCounters = lists:sort(StatsCounters0),
       Stats0 = diff_counters(1000.0 / TSDiff, StatsCounters, PrevCounters, []),
       Stats = lists:merge(Stats0, lists:sort(StatsGauges)),
  -    {Stats, StatsCounters}.
  +    {Stats, StatsCounters, Status}.
   
   aggregate_index_stats([]) ->
       [];
  
positive.code:             end
      end.
  
  massage_stats([], AccGauges, AccCounters) ->
      {AccGauges, AccCounters};
  massage_stats([{K, V} | Rest], AccGauges, AccCounters) ->
      case recognize_name(K) of
          undefined ->
              massage_stats(Rest, AccGauges, AccCounters);
          {counter, NewK} ->
              massage_stats(Rest, AccGauges, [{NewK, V} | AccCounters]);
          {gauge, NewK} ->
              massage_stats(Rest, [{NewK, V} | AccGauges], AccCounters)
      end.
  
  get_stats() ->
  
negative.code:                     ({_K, _V}, Acc) ->
                          Acc
                  end, [], Stats),
      NumConnections = proplists:get_value(index_num_connections, Status, 0),
      NeedsRestart = proplists:get_value(index_needs_restart, Status, false),
      index_status_keeper:update(NumConnections, NeedsRestart, Indexes),
      BucketStats = aggregate_index_stats([{B, K, V} || {{B, _, _} = K, V} <- Stats]),
      PerBucketStats = misc:keygroup(1, BucketStats),
  