nodesStatsRequest.listenerThreaded(false);
client.admin().cluster().nodesStats(nodesStatsRequest, new ActionListener<NodesStatsResponse>() {
@Override public void onResponse(NodesStatsResponse result) {
try {
XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
builder.startObject();
builder.field("cluster_name", result.clusterName().value());
builder.startObject("nodes");
for (NodeStats nodeStats : result) {
builder.startObject(nodeStats.node().id(), XContentBuilder.FieldCaseConversion.NONE);