anchor.diff:                  {title,<<"streaming wakeups/sec">>},
                   {desc,<<"Rate of streaming request wakeups on port 8091">>}]}]}].
   
  -base_stats_directory(BucketId, AddQuery, AddIndex) ->
  +base_stats_directory(BucketId, AddQuery, IndexNodes) ->
       {ok, BucketConfig} = ns_bucket:get_bucket(BucketId),
       Base = case ns_bucket:bucket_type(BucketConfig) of
  -               membase -> membase_stats_description(BucketId, AddQuery, AddIndex);
  +               membase -> membase_stats_description(BucketId, AddQuery, IndexNodes);
                  memcached -> memcached_stats_description()
              end,
       [{struct, server_resources_stats_description()} | Base].
   
  +parse_add_index_param(Param, Params) ->
  +    case proplists:get_value(Param, Params) of
  +        undefined ->
  +            [];
  +        AddIndexX ->
  +            case ejson:decode(AddIndexX) of
  +                <<"all">> ->
  +                    all;
  +                AddIndexDecoded ->
  +                    [binary_to_existing_atom(N, latin1) || N <- AddIndexDecoded]
  +            end
  +    end.
  +
   serve_stats_directory(_PoolId, BucketId, Req) ->
       Params = Req:parse_qs(),
       AddQuery = proplists:get_value("addq", Params, "") =/= "",
  -    AddIndex = case proplists:get_value("addi", Params) of
  -                   undefined ->
  -                       false;
  -                   AddIndexX ->
  -                       case ejson:decode(AddIndexX) of
  -                           <<"all">> ->
  -                               all;
  -                           AddIndexDecoded ->
  -                               [binary_to_existing_atom(N, latin1) || N <- AddIndexDecoded]
  -                       end
  -               end,
  -    BaseDescription = base_stats_directory(BucketId, AddQuery, AddIndex),
  +    IndexNodes = parse_add_index_param("addi", Params),
  +
  +    BaseDescription = base_stats_directory(BucketId, AddQuery, IndexNodes),
       Prefix = menelaus_util:concat_url_path(["pools", "default", "buckets", BucketId, "stats"]),
       Desc = [{struct, add_specific_stats_url(BD, Prefix)} || {struct, BD} <- BaseDescription],
       menelaus_util:reply_json(Req, {struct, [{blocks, Desc}]}).
  
positive.code:                           {desc,<<"Number of backoffs for other DCP connections">>}]}
                 ]}]}]
          ++ couchbase_view_stats_descriptions(BucketId)
          ++ couchbase_index_stats_descriptions(BucketId, AddIndex)
          ++ couchbase_replication_stats_descriptions(BucketId)
          ++ couchbase_goxdcr_stats_descriptions(BucketId)
          ++ case AddQuery of
  
negative.code:                            {name, <<"query_invalid_requests">>},
                             {desc, <<"Number of requests for unsupported endpoints per second, specifically HTTP requests for all endpoints not supported by the query engine. For example, a request for http://localhost:8093/foo will be included. Potentially useful in identifying DOS attacks.">>}]}]}]}].
  
  membase_query_stats_description(false) ->
      [];
  membase_query_stats_description(true) ->
      [{struct,[{title,<<"N1QL queries/sec">>},
                {name, <<"query_requests">>},
                {desc, <<"Number of N1QL requests processed per second">>}]}].
  
  membase_index_stats_description([]) ->
      [];
  membase_index_stats_description(_) ->
      [{struct, [{isBytes, true},
                 {title, <<"index data size">>},
                 {name, global_index_stat(<<"data_size">>)},
                 {desc, <<"Actual data size consumed by the index">>}]},
       {struct, [{title, <<"index disk size">>},
                 {name, global_index_stat(<<"disk_size">>)},
                 {desc, <<"Total disk file size consumed by the index">>},
                 {isBytes, true}]},
       {struct, [{title, <<"index fragmentation %">>},
                 {name, global_index_stat(<<"fragmentation">>)},
                 {desc, <<"Percentage fragmentation of the index. Note: at small index sizes of less than a hundred kB, the static overhead of the index disk file will inflate the index fragmentation percentage">>}]},
       {struct, [{title, <<"index scanned/sec">>},
                 {name, global_index_stat(<<"num_rows_returned">>)},
                 {desc, <<"Number of index items scanned by the indexer per second">>}]}].
  
  membase_stats_description(BucketId, AddQuery, IndexNodes) ->
      [{struct,[{blockName,<<"Summary">>},
                {stats,
                 [{struct,[{title,<<"ops per second">>},
  