anchor.diff:      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) ->
  +    massage_stats(Indexer, Ets, GrabbedStats, #stats_accumulators{}).
  +
  +massage_stats(_Indexer, _Ets, [], Acc) ->
  +    Acc;
  +massage_stats(Indexer, Ets, [{K, V} | Rest], Acc) ->
       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)
  +            massage_stats(Indexer, Ets, Rest, Acc);
  +        {Pos, NewK} ->
  +            massage_stats(
  +              Indexer, Ets, Rest, setelement(Pos, Acc, [{NewK, V} | element(Pos, Acc)]))
       end.
   
   grab_stats(#state{indexer = Indexer}) ->
  
positive.code: process_stats(TS, GrabbedStats, PrevCounters, PrevTS, #state{indexer = Indexer,
                                                               buckets = KnownBuckets,
                                                               default_stats = Defaults} = State) ->
      {Gauges0, Counters, Status, ServiceGauges, ServiceCounters} =
          massage_stats(Indexer, ets_name(Indexer), GrabbedStats),
      Gauges = Indexer:compute_gauges(Gauges0) ++ Gauges0,
  
      {Stats, SortedBucketCounters} =
          base_stats_collector:calculate_counters(TS, Gauges, Counters, PrevCounters, PrevTS),
  
      index_status_keeper:update(Indexer, Status),
      AllServiceGauges = Indexer:compute_service_gauges(ServiceGauges) ++ ServiceGauges,
      {ServiceStats1, SortedServiceCounters} =
          base_stats_collector:calculate_counters(TS, AllServiceGauges, ServiceCounters, PrevCounters, PrevTS),
      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),
  
negative.code: do_recognize_bucket_metric(Indexer, K) ->
      case binary:split(K, <<":">>, [global]) of
          [Bucket, Index, Metric] ->
              Type = find_type(Metric, [{#stats_accumulators.gauges, Indexer:get_gauges()},
                                        {#stats_accumulators.counters, Indexer:get_counters()}]),
  
              case Type of
                  not_found ->
  