anchor.diff:          CalculateStats(#stats_accumulators.sys_gauges, #stats_accumulators.sys_counters,
                          compute_service_gauges),
   
  +    ServiceStats2 = aggregate_service_stats(Service, ServiceStats1),
  +
       ServiceStats = [{service_event_name(Service),
  -                     finalize_stats(ServiceStats1)}],
  +                     finalize_stats(ServiceStats2)}],
       Prefix = service_prefix(Service),
       AggregatedStats =
           [{Prefix ++ binary_to_list(Bucket), Values} ||
  
positive.code:     SortedCounters = lists:sort(AllCounters),
      {AggregatedStats, SortedCounters, State}.
  
  aggregate_stats(Service, Stats, Buckets, Defaults) ->
      do_aggregate_stats(Service, Stats, Buckets, Defaults, []).
  
  
negative.code:             find_type(Name, Rest)
      end.
  
  global_types(Service) ->
      [{#stats_accumulators.sys_gauges, Service:get_service_gauges()},
       {#stats_accumulators.sys_counters, Service:get_service_counters()}].
  
  bucket_types(Service) ->
      [{#stats_accumulators.gauges, Service:get_gauges()},
       {#stats_accumulators.counters, Service:get_counters()}].
  
  do_recognize_name(_Service, <<"needs_restart">>) ->
      {#stats_accumulators.status, index_needs_restart};
  do_recognize_name(_Service, <<"num_connections">>) ->
      {#stats_accumulators.status, index_num_connections};
  do_recognize_name(Service, K) when is_binary(K) ->
      case find_type(K, global_types(Service)) of
          not_found ->
              do_recognize_complex_name(Service, K);
          Type ->
              NewKey = list_to_binary(service_stat_prefix(Service) ++
                                          binary_to_list(K)),
              {Type, NewKey}
      end;
  do_recognize_name(Service, K) ->
      do_recognize_complex_name(Service, K).
  
  do_recognize_complex_name(Service, K) ->
      case Service:split_stat_name(K) of
          [Bucket, Item, Metric] ->
              case find_type(Metric, bucket_types(Service)) of
                  not_found ->
                      undefined;
                  Type ->
                      {Type, {Bucket, Item, Metric}}
              end;
          [Item, Metric] ->
              case find_type(Metric, global_types(Service)) of
                  not_found ->
                      undefined;
                  Type ->
                      {Type, {Item, Metric}}
              end;
          _ ->
              undefined
  