本文整理了Java中org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequestBuilder.execute()
方法的一些代码示例,展示了NodesStatsRequestBuilder.execute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NodesStatsRequestBuilder.execute()
方法的具体详情如下:
包路径:org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequestBuilder
类名称:NodesStatsRequestBuilder
方法名:execute
暂无
代码示例来源:origin: SonarSource/sonarqube
@Override
public NodesStatsResponse get() {
Profiler profiler = Profiler.createIfTrace(EsClient.LOGGER).start();
try {
return super.execute().actionGet();
} catch (Exception e) {
throw new IllegalStateException(String.format("Fail to execute %s", toString()), e);
} finally {
if (profiler.isTraceEnabled()) {
profiler.stopTrace(toString());
}
}
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void execute_should_throw_an_unsupported_operation_exception() {
thrown.expect(UnsupportedOperationException.class);
thrown.expectMessage("execute() should not be called as it's used for asynchronous");
es.client().prepareNodesStats(FakeIndexDefinition.INDEX).execute();
}
代码示例来源:origin: com.netflix.raigad/raigad
public static NodesStatsResponse getNodesStatsResponse(IConfiguration config)
{
try
{
return ESTransportClient.instance(config).ndStatsRequestBuilder.execute().actionGet();
}
catch (Exception e)
{
logger.error(e.getMessage(), e);
}
return null;
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-server
@Override
public NodesStatsResponse get() {
Profiler profiler = Profiler.createIfTrace(EsClient.LOGGER).start();
try {
return super.execute().actionGet();
} catch (Exception e) {
throw new IllegalStateException(String.format("Fail to execute %s", toString()), e);
} finally {
if (profiler.isTraceEnabled()) {
profiler.stopTrace(toString());
}
}
}
代码示例来源:origin: com.strapdata.elasticsearch.test/framework
@Override
public void ensureEstimatedStats() {
if (size() > 0) {
NodesStatsResponse nodeStats = client().admin().cluster().prepareNodesStats()
.clear().setBreaker(true).setIndices(true).execute().actionGet();
for (NodeStats stats : nodeStats.getNodes()) {
assertThat("Fielddata breaker not reset to 0 on node: " + stats.getNode(),
stats.getBreaker().getStats(CircuitBreaker.FIELDDATA).getEstimated(), equalTo(0L));
assertThat("Accounting breaker not reset to " + stats.getIndices().getSegments().getMemoryInBytes() +
" on node: " + stats.getNode(),
stats.getBreaker().getStats(CircuitBreaker.ACCOUNTING).getEstimated(),
equalTo(stats.getIndices().getSegments().getMemoryInBytes()));
// ExternalTestCluster does not check the request breaker,
// because checking it requires a network request, which in
// turn increments the breaker, making it non-0
assertThat("Fielddata size must be 0 on node: " +
stats.getNode(), stats.getIndices().getFieldData().getMemorySizeInBytes(), equalTo(0L));
assertThat("Query cache size must be 0 on node: " +
stats.getNode(), stats.getIndices().getQueryCache().getMemorySizeInBytes(), equalTo(0L));
assertThat("FixedBitSet cache size must be 0 on node: " +
stats.getNode(), stats.getIndices().getSegments().getBitsetMemoryInBytes(), equalTo(0L));
}
}
}
代码示例来源:origin: sirensolutions/siren-join
public void memStatus() throws IOException {
NodeStats[] nodeStats = client.admin().cluster().prepareNodesStats()
.setJvm(true).setIndices(true).setTransport(true)
.execute().actionGet().getNodes();
log("==== MEMORY ====");
log("Committed heap size: [0]=" + nodeStats[0].getJvm().getMem().getHeapCommitted() + ", [1]=" + nodeStats[1].getJvm().getMem().getHeapCommitted());
log("Used heap size: [0]=" + nodeStats[0].getJvm().getMem().getHeapUsed() + ", [1]=" + nodeStats[1].getJvm().getMem().getHeapUsed());
log("FieldData cache size: [0]=" + nodeStats[0].getIndices().getFieldData().getMemorySize() + ", [1]=" + nodeStats[1].getIndices().getFieldData().getMemorySize());
log("Query cache size: [0]=" + nodeStats[0].getIndices().getQueryCache().getMemorySize() + ", [1]=" + nodeStats[1].getIndices().getQueryCache().getMemorySize());
log("");
log("==== NETWORK ====");
log("Transport: [0]=" + nodeStats[0].getTransport().toXContent(jsonBuilder(), ToXContent.EMPTY_PARAMS).string() + ", [1]=" + nodeStats[1].getTransport().toXContent(jsonBuilder(), ToXContent.EMPTY_PARAMS).string());
log("");
}
代码示例来源:origin: sirensolutions/siren-join
public void memStatus() throws IOException {
NodeStats[] nodeStats = client.admin().cluster().prepareNodesStats()
.setJvm(true).setIndices(true).setTransport(true)
.execute().actionGet().getNodes();
log("==== MEMORY ====");
log("Committed heap size: [0]=" + nodeStats[0].getJvm().getMem().getHeapCommitted() + ", [1]=" + nodeStats[1].getJvm().getMem().getHeapCommitted());
log("Used heap size: [0]=" + nodeStats[0].getJvm().getMem().getHeapUsed() + ", [1]=" + nodeStats[1].getJvm().getMem().getHeapUsed());
log("FieldData cache size: [0]=" + nodeStats[0].getIndices().getFieldData().getMemorySize() + ", [1]=" + nodeStats[1].getIndices().getFieldData().getMemorySize());
log("Query cache size: [0]=" + nodeStats[0].getIndices().getQueryCache().getMemorySize() + ", [1]=" + nodeStats[1].getIndices().getQueryCache().getMemorySize());
log("");
log("==== NETWORK ====");
log("Transport: [0]=" + nodeStats[0].getTransport().toXContent(jsonBuilder(), ToXContent.EMPTY_PARAMS).string() + ", [1]=" + nodeStats[1].getTransport().toXContent(jsonBuilder(), ToXContent.EMPTY_PARAMS).string());
log("");
}
内容来源于网络,如有侵权,请联系作者删除!