anchor.diff:  
               case Stat of
                   {ok, StatAtom} ->
  -                    build_simple_stat_extractor(StatAtom, StatBinary);
  +                    {[StatAtom, StatBinary],
  +                     build_simple_stat_extractor(StatAtom, StatBinary)};
                   error ->
  -                    build_raw_stat_extractor(StatBinary)
  +                    {[StatBinary],
  +                     build_raw_stat_extractor(StatBinary)}
               end
       end.
   
  
positive.code:                                 end, List)
                end, Samples).
  
  get_samples_for_stat(BucketName, StatName, ForNodes, ClientTStamp, Window) ->
      StatExtractor = build_stat_extractor(BucketName, StatName),
  
      {MainNode, MainSamples, RestSamplesRaw}
          = menelaus_stats_gatherer:gather_stats(BucketName, ForNodes, ClientTStamp, Window),
  
      Nodes = [MainNode | [N || {N, _} <- RestSamplesRaw]],
      AllNodesSamples = [{MainNode, lists:reverse(MainSamples)} | RestSamplesRaw],
  
      {[lists:map(StatExtractor, NodeSamples) || {_, NodeSamples} <- AllNodesSamples], Nodes}.
  
  get_samples_from_one_of_kind([Kind | RestKinds], StatName, ClientTStamp, Window) ->
      ForNodes = section_nodes(Kind),
  
negative.code:       Req,
        build_response_for_specific_stat(BucketName, StatName, Params, menelaus_util:local_addr(Req))).
  
  %% Function to extract a simple stat from a list of stats.
  build_simple_stat_extractor(StatAtom, StatBinary) ->
      fun (#stat_entry{timestamp = TS, values = VS}) ->
              V = case dict_safe_fetch(StatAtom, VS, undefined) of
                      undefined ->
                          dict_safe_fetch(StatBinary, VS, undefined);
                      V1 ->
                          V1
                  end,
  
              {TS, V}
      end.
  
  %% Function to extract a raw stat from a list of stats.
  build_raw_stat_extractor(StatBinary) ->
      fun (#stat_entry{timestamp = TS, values = VS}) ->
              {TS, dict_safe_fetch(StatBinary, VS, undefined)}
      end.
  
  %%
  %% Some stats are computed using other stats.
  %% Stats used in the computation are gathered and the ComputeFun is then
  %% applied on them to extract the relevant stat.
  %%
  build_computed_stat_extractor(ComputeFun, Stats) ->
      fun (#stat_entry{timestamp = TS, values = VS}) ->
              Args = [dict_safe_fetch(Name, VS, undefined) || Name <- Stats],
              case lists:member(undefined, Args) of
                  true ->
                      {TS, undefined};
                  _ ->
                      {TS, erlang:apply(ComputeFun, Args)}
              end
      end.
  %%
  %% For the specified StatName, build the list of stats that need to be gathered
  %% and the function to extract them.
  %% E.g. for a computed stat, vb_active_resident_items_ratio, it will return
  %% following:
  %%      {[vb_active_num_non_resident, curr_items], <extractor_function>}.
  %%
  build_stat_list_and_extractor(BucketName, StatName) ->
      ExtraStats = computed_stats_lazy_proplist(BucketName),
      build_stat_list_and_extractor_inner(ExtraStats, StatName).
  
  build_stat_list_and_extractor_inner(ExtraStats, StatName) ->
      StatBinary = list_to_binary(StatName),
      case lists:keyfind(StatBinary, 1, ExtraStats) of
          {_K, {F, Meta}} ->
              {Meta, build_computed_stat_extractor(F, Meta)};
          false ->
              Stat = try
                         {ok, list_to_existing_atom(StatName)}
  