Set<String> metrics = Strings.splitStringByCommaToSet(request.param("metric", "_all"));
// short cut, if no metrics have been specified in URI
if (metrics.size() == 1 && metrics.contains("_all")) {
indicesStatsRequest.all();
} else {
indicesStatsRequest.clear();
indicesStatsRequest.docs(metrics.contains("docs"));
indicesStatsRequest.store(metrics.contains("store"));
indicesStatsRequest.indexing(metrics.contains("indexing"));
indicesStatsRequest.search(metrics.contains("search"));
indicesStatsRequest.get(metrics.contains("get"));