anchor.diff:              {TS, dict_safe_fetch(StatBinary, VS, undefined)}
       end.
   
  -build_stat_extractor(StatName) ->
  -    ExtraStats = computed_stats_lazy_proplist(),
  +build_stat_extractor(BucketName, StatName) ->
  +    ExtraStats = computed_stats_lazy_proplist(BucketName),
   
       Stat = try
                  {ok, list_to_existing_atom(StatName)}
  
positive.code:     {MainSamples, Replies, ClientTStamp, {Step, _, Window}}
          = gather_op_stats(BucketName, all, Params),
  
      StatExtractor = build_stat_extractor(StatName),
  
      RestSamplesRaw = lists:keydelete(node(), 1, Replies),
      Nodes = [node() | [N || {N, _} <- RestSamplesRaw]],
  
negative.code:                                end
                         end),
  
      %% compute a list of per replication XDC stats
      Reps = xdc_replication_sup:get_replications(list_to_binary(BucketName)),
      XDCAllRepStats =
          lists:flatmap(fun ({Id, _Pid}) ->
                                Prefix = <<"replications/", Id/binary,"/">>,
  
                                WtAvgMetaLatency = Z2(<<Prefix/binary, "meta_latency_aggr">>,
                                                      <<Prefix/binary, "meta_latency_wt">>,
                                                      fun (Total, Count) ->
                                                              try Total / Count
                                                              catch error:badarith -> 0
                                                              end
                                                      end),
  
                                WtAvgDocsLatency = Z2(<<Prefix/binary, "docs_latency_aggr">>,
                                                      <<Prefix/binary, "docs_latency_wt">>,
                                                      fun (Total, Count) ->
                                                              try Total / Count
                                                              catch error:badarith -> 0
                                                              end
                                                      end),
  
                                PercentCompleteness = Z2(<<Prefix/binary, "docs_checked">>,
                                                         <<Prefix/binary, "changes_left">>,
                                                         fun (Checked, Left) ->
                                                                 try (100 * Checked) / (Checked + Left)
                                                                 catch error:badarith -> 0
                                                                 end
                                                         end),
  
                                [{<<Prefix/binary, "wtavg_meta_latency">>, WtAvgMetaLatency},
                                 {<<Prefix/binary, "wtavg_docs_latency">>, WtAvgDocsLatency},
                                 {<<Prefix/binary, "percent_completeness">>, PercentCompleteness}]
                        end,
                        Reps),
  
      [{couch_total_disk_size, TotalDisk},
       {couch_docs_fragmentation, DocsFragmentation},
  