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:             find_type(Name, Rest)
      end.
  
  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) ->
      Type = find_type(K, [{#stats_accumulators.sys_gauges,
                            Service:get_service_gauges()},
                           {#stats_accumulators.sys_counters,
                            Service:get_service_counters()}]),
      case Type of
          not_found ->
              do_recognize_bucket_metric(Service, K);
          _ ->
              NewKey = list_to_binary(service_stat_prefix(Service) ++
                                          binary_to_list(K)),
              {Type, NewKey}
      end.
  
  do_recognize_bucket_metric(Service, K) ->
      case Service:split_stat_name(K) of
          [Bucket, Item, Metric] ->
              Type = find_type(Metric, [{#stats_accumulators.gauges,
                                         Service:get_gauges()},
                                        {#stats_accumulators.counters,
                                         Service:get_counters()}]),
  
              case Type of
                  not_found ->
                      undefined;
                  _ ->
                      {Type, {Bucket, Item, Metric}}
              end;
          _ ->
              undefined
  
negative.code:     {finalize_stats(Acc), []};
  do_aggregate_bucket_stats(Service, Acc, Bucket,
                            [{{Bucket, Item, Name}, V} | Rest]) ->
      NewAcc = aggregate_item_stat(Service, Item, Name, V, Acc),
      do_aggregate_bucket_stats(Service, NewAcc, Bucket, Rest);
  do_aggregate_bucket_stats(_Service, Acc, _, Stats) ->
      {finalize_stats(Acc), Stats}.
  
  