anchor.diff:  do_recognize_bucket_metric(Indexer, K) ->
       case binary:split(K, <<":">>, [global]) of
           [Bucket, Index, Metric] ->
  -            Type = find_type(Metric, [{gauge, Indexer:get_gauges()},
  -                                      {counter, Indexer:get_counters()}]),
  +            Type = find_type(Metric, [{#stats_accumulators.gauges, Indexer:get_gauges()},
  +                                      {#stats_accumulators.counters, Indexer:get_counters()}]),
   
               case Type of
                   not_found ->
  
positive.code:     end.
  
  massage_stats(Indexer, Ets, GrabbedStats) ->
      massage_stats(Indexer, Ets, GrabbedStats, [], [], [], [], []).
  
  massage_stats(_Indexer, _Ets, [], AccGauges, AccCounters, AccStatus, AccSysGauges, AccSysCounters) ->
      {AccGauges, AccCounters, AccStatus, AccSysGauges, AccSysCounters};
  massage_stats(Indexer, Ets, [{K, V} | Rest], AccGauges, AccCounters,
                AccStatus, AccSysGauges, AccSysCounters) ->
      case recognize_name(Indexer, Ets, K) of
          undefined ->
              massage_stats(Indexer, Ets, Rest, AccGauges, AccCounters, AccStatus,
                            AccSysGauges, AccSysCounters);
          {counter, NewK} ->
              massage_stats(Indexer, Ets, Rest, AccGauges,
                            [{NewK, V} | AccCounters], AccStatus, AccSysGauges, AccSysCounters);
          {gauge, NewK} ->
              massage_stats(Indexer, Ets, Rest, [{NewK, V} | AccGauges],
                            AccCounters, AccStatus, AccSysGauges, AccSysCounters);
          {service_gauge, NewK} ->
              massage_stats(Indexer, Ets, Rest, AccGauges, AccCounters,
                            AccStatus, [{NewK, V} | AccSysGauges], AccSysCounters);
          {service_counter, NewK} ->
              massage_stats(Indexer, Ets, Rest, AccGauges, AccCounters,
                            AccStatus, AccSysGauges, [{NewK, V} | AccSysCounters]);
          {status, NewK} ->
              massage_stats(Indexer, Ets, Rest, AccGauges, AccCounters,
                            [{NewK, V} | AccStatus], AccSysGauges, AccSysCounters)
      end.
  
  grab_stats(#state{indexer = Indexer}) ->
  
negative.code: process_stats(TS, GrabbedStats, PrevCounters, PrevTS, #state{indexer = Indexer,
                                                               buckets = KnownBuckets,
                                                               default_stats = Defaults} = State) ->
      MassagedStats =
          massage_stats(Indexer, ets_name(Indexer), GrabbedStats),
  
      CalculateStats =
          fun (GaugesPos, CountersPos, ComputeGauges) ->
                  Gauges0 = element(GaugesPos, MassagedStats),
                  Gauges = Indexer:ComputeGauges(Gauges0) ++ Gauges0,
                  Counters = element(CountersPos, MassagedStats),
                  base_stats_collector:calculate_counters(TS, Gauges, Counters, PrevCounters, PrevTS)
          end,
  
      index_status_keeper:update(Indexer, MassagedStats#stats_accumulators.status),
  
      {Stats, SortedBucketCounters} =
          CalculateStats(#stats_accumulators.gauges, #stats_accumulators.counters, compute_gauges),
      {ServiceStats1, SortedServiceCounters} =
          CalculateStats(#stats_accumulators.sys_gauges, #stats_accumulators.sys_counters,
                         compute_service_gauges),
  
      ServiceStats = [{Indexer:service_event_name(),
                       finalize_index_stats(ServiceStats1)}],
      Prefix = Indexer:prefix(),
      AggregatedStats =
          [{Prefix ++ binary_to_list(Bucket), Values} ||
              {Bucket, Values} <- aggregate_index_stats(Indexer, Stats, KnownBuckets, Defaults)] ++
          ServiceStats,
  
      AllCounters = SortedBucketCounters ++ SortedServiceCounters,
      SortedCounters = lists:sort(AllCounters),
  