NodesStatsResponse nir = tc.admin().cluster().nodesStats(new NodesStatsRequest()).actionGet(); sb.append(Strings.toString(nir,true, true)); } catch (Exception e1) {
/** * Creates a nodes stats request against one or more nodes. Pass {@code null} or an empty array for all nodes. * * @param nodesIds The nodes ids to get the stats for * @return The nodes info request * @see org.elasticsearch.client.ClusterAdminClient#nodesStats(org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest) */ public static NodesStatsRequest nodesStatsRequest(String... nodesIds) { return new NodesStatsRequest(nodesIds); }
public NodesStatsRequestBuilder(ElasticsearchClient client, NodesStatsAction action) { super(client, action, new NodesStatsRequest()); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); request = new NodesStatsRequest(); request.readFrom(in); }
/** * Retrieve the latest nodes stats, calling the listener when complete * @return a latch that can be used to wait for the nodes stats to complete if desired */ protected CountDownLatch updateNodeStats(final ActionListener<NodesStatsResponse> listener) { final CountDownLatch latch = new CountDownLatch(1); final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.fs(true); nodesStatsRequest.timeout(fetchTimeout); client.admin().cluster().nodesStats(nodesStatsRequest, new LatchedActionListener<>(listener, latch)); return latch; }
/** * Creates a nodes stats request against one or more nodes. Pass {@code null} or an empty array for all nodes. * * @param nodesIds The nodes ids to get the stats for * @return The nodes info request * @see org.elasticsearch.client.ClusterAdminClient#nodesStats(org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest) */ public static NodesStatsRequest nodesStatsRequest(String... nodesIds) { return new NodesStatsRequest(nodesIds); }
@Override protected RestChannelConsumer doCatRequest(final RestRequest request, final NodeClient client) { final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.indices(true); String[] fields = request.paramAsStringArray("fields", null); nodesStatsRequest.indices().fieldDataFields(fields == null ? new String[] {"*"} : fields); return channel -> client.admin().cluster().nodesStats(nodesStatsRequest, new RestResponseListener<NodesStatsResponse>(channel) { @Override public RestResponse buildResponse(NodesStatsResponse nodeStatses) throws Exception { return RestTable.buildResponse(buildTable(request, nodeStatses), channel); } }); }
/** * Creates a nodes stats request against one or more nodes. Pass <tt>null</tt> or an empty array for all nodes. * * @param nodesIds The nodes ids to get the stats for * @return The nodes info request * @see org.elasticsearch.client.ClusterAdminClient#nodesStats(org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest) */ public static NodesStatsRequest nodesStatsRequest(String... nodesIds) { return new NodesStatsRequest(nodesIds); }
/** * Creates a nodes stats request against one or more nodes. Pass <tt>null</tt> or an empty array for all nodes. * * @param nodesIds The nodes ids to get the stats for * @return The nodes info request * @see org.elasticsearch.client.ClusterAdminClient#nodesStats(org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest) */ public static NodesStatsRequest nodesStatsRequest(String... nodesIds) { return new NodesStatsRequest(nodesIds); }
public NodesStatsRequestBuilder(ElasticsearchClient client, NodesStatsAction action) { super(client, action, new NodesStatsRequest()); }
Set<String> metrics = Strings.tokenizeByCommaToSet(request.param("metric", "_all")); NodesStatsRequest nodesStatsRequest = new NodesStatsRequest(nodesIds); nodesStatsRequest.timeout(request.param("timeout"));
ActionFuture<NodesStatsResponse> nsr = client().admin().cluster().nodesStats(new NodesStatsRequest()); <br> System.out.println(nsr.get().toString()); </br>
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); request = new NodesStatsRequest(); request.readFrom(in); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); request = new NodesStatsRequest(); request.readFrom(in); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); request = new NodesStatsRequest(); request.readFrom(in); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); request = new NodesStatsRequest(); request.readFrom(in); }
@Override public void processResponse(final ClusterStateResponse state) { NodesStatsRequest statsRequest = new NodesStatsRequest(nodes); statsRequest.clear().fs(true).indices(new CommonStatsFlags(CommonStatsFlags.Flag.Store)); client.admin().cluster().nodesStats(statsRequest, new RestResponseListener<NodesStatsResponse>(channel) { @Override public RestResponse buildResponse(NodesStatsResponse stats) throws Exception { Table tab = buildTable(request, state, stats); return RestTable.buildResponse(tab, channel); } }); } });
/** * Retrieve the latest nodes stats, calling the listener when complete * @return a latch that can be used to wait for the nodes stats to complete if desired */ protected CountDownLatch updateNodeStats(final ActionListener<NodesStatsResponse> listener) { final CountDownLatch latch = new CountDownLatch(1); final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.fs(true); nodesStatsRequest.timeout(fetchTimeout); client.admin().cluster().nodesStats(nodesStatsRequest, new LatchedActionListener<>(listener, latch)); return latch; }
/** * Retrieve the latest nodes stats, calling the listener when complete * @return a latch that can be used to wait for the nodes stats to complete if desired */ protected CountDownLatch updateNodeStats(final ActionListener<NodesStatsResponse> listener) { final CountDownLatch latch = new CountDownLatch(1); final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.fs(true); nodesStatsRequest.timeout(fetchTimeout); client.admin().cluster().nodesStats(nodesStatsRequest, new LatchedActionListener<>(listener, latch)); return latch; }
/** * Retrieve the latest nodes stats, calling the listener when complete * @return a latch that can be used to wait for the nodes stats to complete if desired */ protected CountDownLatch updateNodeStats(final ActionListener<NodesStatsResponse> listener) { final CountDownLatch latch = new CountDownLatch(1); final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.fs(true); nodesStatsRequest.timeout(fetchTimeout); client.admin().cluster().nodesStats(nodesStatsRequest, new LatchedActionListener<>(listener, latch)); return latch; }