本文整理汇总了Java中org.elasticsearch.indices.NodeIndicesStats类的典型用法代码示例。如果您正苦于以下问题:Java NodeIndicesStats类的具体用法?Java NodeIndicesStats怎么用?Java NodeIndicesStats使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NodeIndicesStats类属于org.elasticsearch.indices包,在下文中一共展示了NodeIndicesStats类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NodeStats
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
public NodeStats(DiscoveryNode node, long timestamp, @Nullable NodeIndicesStats indices,
@Nullable OsStats os, @Nullable ProcessStats process, @Nullable JvmStats jvm, @Nullable ThreadPoolStats threadPool,
@Nullable FsInfo fs, @Nullable TransportStats transport, @Nullable HttpStats http,
@Nullable AllCircuitBreakerStats breaker,
@Nullable ScriptStats scriptStats,
@Nullable DiscoveryStats discoveryStats,
@Nullable IngestStats ingestStats) {
super(node);
this.timestamp = timestamp;
this.indices = indices;
this.os = os;
this.process = process;
this.jvm = jvm;
this.threadPool = threadPool;
this.fs = fs;
this.transport = transport;
this.http = http;
this.breaker = breaker;
this.scriptStats = scriptStats;
this.discoveryStats = discoveryStats;
this.ingestStats = ingestStats;
}
示例2: readFrom
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
timestamp = in.readVLong();
if (in.readBoolean()) {
indices = NodeIndicesStats.readIndicesStats(in);
}
os = in.readOptionalWriteable(OsStats::new);
process = in.readOptionalWriteable(ProcessStats::new);
jvm = in.readOptionalWriteable(JvmStats::new);
threadPool = in.readOptionalWriteable(ThreadPoolStats::new);
fs = in.readOptionalWriteable(FsInfo::new);
transport = in.readOptionalWriteable(TransportStats::new);
http = in.readOptionalWriteable(HttpStats::new);
breaker = in.readOptionalWriteable(AllCircuitBreakerStats::new);
scriptStats = in.readOptionalWriteable(ScriptStats::new);
discoveryStats = in.readOptionalWriteable(DiscoveryStats::new);
ingestStats = in.readOptionalWriteable(IngestStats::new);
}
示例3: NodeStats
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
public NodeStats(DiscoveryNode node, long timestamp, @Nullable NodeIndicesStats indices,
@Nullable OsStats os, @Nullable ProcessStats process, @Nullable JvmStats jvm, @Nullable ThreadPoolStats threadPool,
@Nullable FsInfo fs, @Nullable TransportStats transport, @Nullable HttpStats http,
@Nullable AllCircuitBreakerStats breaker,
@Nullable ScriptStats scriptStats) {
super(node);
this.timestamp = timestamp;
this.indices = indices;
this.os = os;
this.process = process;
this.jvm = jvm;
this.threadPool = threadPool;
this.fs = fs;
this.transport = transport;
this.http = http;
this.breaker = breaker;
this.scriptStats = scriptStats;
}
示例4: readFrom
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
timestamp = in.readVLong();
if (in.readBoolean()) {
indices = NodeIndicesStats.readIndicesStats(in);
}
if (in.readBoolean()) {
os = OsStats.readOsStats(in);
}
if (in.readBoolean()) {
process = ProcessStats.readProcessStats(in);
}
if (in.readBoolean()) {
jvm = JvmStats.readJvmStats(in);
}
if (in.readBoolean()) {
threadPool = ThreadPoolStats.readThreadPoolStats(in);
}
if (in.readBoolean()) {
fs = FsInfo.readFsInfo(in);
}
if (in.readBoolean()) {
transport = TransportStats.readTransportStats(in);
}
if (in.readBoolean()) {
http = HttpStats.readHttpStats(in);
}
breaker = AllCircuitBreakerStats.readOptionalAllCircuitBreakerStats(in);
scriptStats = in.readOptionalStreamable(new ScriptStats());
}
示例5: updateRefreshFlush
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
private void updateRefreshFlush(NodeIndicesStatsBean nodeIndicesStatsBean, NodeIndicesStats nodeIndicesStats) {
nodeIndicesStatsBean.refreshTotal = nodeIndicesStats.getRefresh().getTotal();
nodeIndicesStatsBean.refreshTotalTime = nodeIndicesStats.getRefresh().getTotalTimeInMillis();
if (nodeIndicesStatsBean.refreshTotal != 0) {
nodeIndicesStatsBean.refreshAvgTimeInMillisPerRequest = nodeIndicesStatsBean.refreshTotalTime / nodeIndicesStatsBean.refreshTotal;
}
nodeIndicesStatsBean.flushTotal = nodeIndicesStats.getFlush().getTotal();
nodeIndicesStatsBean.flushTotalTime = nodeIndicesStats.getFlush().getTotalTimeInMillis();
if (nodeIndicesStatsBean.flushTotal != 0) {
nodeIndicesStatsBean.flushAvgTimeInMillisPerRequest = nodeIndicesStatsBean.flushTotalTime / nodeIndicesStatsBean.flushTotal;
}
}
示例6: updateMerge
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
private void updateMerge(NodeIndicesStatsBean nodeIndicesStatsBean, NodeIndicesStats nodeIndicesStats) {
nodeIndicesStatsBean.mergesCurrent = nodeIndicesStats.getMerge().getCurrent();
nodeIndicesStatsBean.mergesCurrentDocs = nodeIndicesStats.getMerge().getCurrentNumDocs();
nodeIndicesStatsBean.mergesCurrentSize = nodeIndicesStats.getMerge().getCurrentSizeInBytes();
nodeIndicesStatsBean.mergesTotal = nodeIndicesStats.getMerge().getTotal();
nodeIndicesStatsBean.mergesTotalTime = nodeIndicesStats.getMerge().getTotalTimeInMillis();
nodeIndicesStatsBean.mergesTotalSize = nodeIndicesStats.getMerge().getTotalSizeInBytes();
}
示例7: run
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
public void run()
{
while (!closed) {
DiscoveryNode node = clusterService.localNode();
boolean isClusterStarted = clusterService.lifecycleState().equals(Lifecycle.State.STARTED);
if (isClusterStarted && node != null && node.isMasterNode()) {
NodeIndicesStats nodeIndicesStats = indicesService.stats(false);
CommonStatsFlags commonStatsFlags = new CommonStatsFlags().clear();
NodeStats nodeStats = nodeService.stats(commonStatsFlags, true, true, true, true, true, true, true, true);
List<IndexShard> indexShards = getIndexShards(indicesService);
StatsdReporter statsdReporter = new StatsdReporter(nodeIndicesStats, indexShards, nodeStats, statsdClient);
statsdReporter.run();
}
else {
if (node != null) {
logger.debug("[{}]/[{}] is not master node, not triggering update", node.getId(), node.getName());
}
}
try {
Thread.sleep(statsdRefreshInternal.millis());
}
catch (InterruptedException e1) {
continue;
}
}
}
示例8: StatsdReporter
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
public StatsdReporter(NodeIndicesStats nodeIndicesStats, List<IndexShard> indexShards, NodeStats nodeStats,
StatsDClient statsdClient)
{
this.indexShards = indexShards;
this.nodeStats = nodeStats;
this.nodeIndicesStats = nodeIndicesStats;
this.statsdClient = statsdClient;
}
示例9: GraphiteReporter
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
public GraphiteReporter(String host, int port, String prefix, NodeIndicesStats nodeIndicesStats,
List<IndexShard> indexShards, NodeStats nodeStats,
Pattern graphiteInclusionRegex, Pattern graphiteExclusionRegex) {
this.host = host;
this.port = port;
this.prefix = prefix;
this.indexShards = indexShards;
this.nodeStats = nodeStats;
this.graphiteInclusionRegex = graphiteInclusionRegex;
this.graphiteExclusionRegex = graphiteExclusionRegex;
this.timestamp = Long.toString(System.currentTimeMillis() / 1000);
this.nodeIndicesStats = nodeIndicesStats;
}
示例10: run
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
public void run() {
while (!closed) {
DiscoveryNode node = clusterService.localNode();
boolean isClusterStarted = clusterService.lifecycleState().equals(Lifecycle.State.STARTED);
if (isClusterStarted && node != null && node.isMasterNode()) {
NodeIndicesStats nodeIndicesStats = indicesService.stats(false);
CommonStatsFlags commonStatsFlags = new CommonStatsFlags().clear();
NodeStats nodeStats = nodeService.stats(commonStatsFlags, true, true, true, true, true, true, true, true, true);
List<IndexShard> indexShards = getIndexShards(indicesService);
GraphiteReporter graphiteReporter = new GraphiteReporter(graphiteHost, graphitePort, graphitePrefix,
nodeIndicesStats, indexShards, nodeStats, graphiteInclusionRegex, graphiteExclusionRegex);
graphiteReporter.run();
} else {
if (node != null) {
logger.debug("[{}]/[{}] is not master node, not triggering update", node.getId(), node.getName());
}
}
try {
Thread.sleep(graphiteRefreshInternal.millis());
} catch (InterruptedException e1) {
continue;
}
}
}
示例11: getIndices
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
/**
* Indices level stats.
*/
@Nullable
public NodeIndicesStats getIndices() {
return this.indices;
}
示例12: generateMetrics
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
@Override
public void generateMetrics(PrometheusFormatWriter writer, NodeIndicesStats indicesStats) {
logger.debug("Generating output based on indicies stats: {}", indicesStats);
//StoreStats
writer.addGauge("es_common_store_size")
.withHelp("Elasticsearch storage size (in bytes)")
.value(indicesStats.getStore().getSizeInBytes());
//DocsStats
writer.addCounter("es_common_docs_count")
.withHelp("Elasticsearch documents counter")
.value(indicesStats.getDocs().getCount());
writer.addCounter("es_common_docs_deleted_count")
.withHelp("Elasticsearch documents deleted")
.value(indicesStats.getDocs().getDeleted());
//Indexing stats per index
ValueWriter es_docindex_count = writer.addCounter("es_docindex_count")
.withHelp("Counter of indexing operations");
ValueWriter es_docindexfailed_count = writer.addCounter("es_docindexfailed_count")
.withHelp("Counter of failed indexing operations");
ValueWriter es_docdelete_count = writer.addCounter("es_docdelete_count")
.withHelp("Number of delete operations");
ValueWriter es_docdelete_current = writer.addGauge("es_docdelete_current")
.withHelp("Number of active delete operations");
ValueWriter es_docindex_current = writer.addGauge("es_docindex_current")
.withHelp("Number of active index operations");
ValueWriter es_docindex_isthrottled = writer.addGauge("es_docindex_isthrottled")
.withHelp("Flag to check is node throttled");
//Index data per each index
if (indicesStats.getIndexing().getTypeStats() != null) {
logger.debug("Dumping data from indexes: {}", indicesStats.getIndexing().getTypeStats());
for (Map.Entry<String, IndexingStats.Stats> entry : indicesStats.getIndexing().getTypeStats().entrySet()) {
logger.debug("Dumping data from index: {}", entry);
String index = entry.getKey();
IndexingStats.Stats stats = entry.getValue();
es_docindex_count.value(stats.getIndexCount(), "index", index);
es_docindexfailed_count.value(stats.getIndexFailedCount(), "index", index);
es_docdelete_count.value(stats.getDeleteCount(), "index", index);
es_docdelete_current.value(stats.getDeleteCurrent(), "index", index);
es_docindex_current.value(stats.getIndexCurrent(), "index", index);
es_docindex_isthrottled.value(stats.isThrottled() ? 1 : 0, "index", index);
}
}
}
示例13: execute
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
@Override
public void execute() throws Exception {
// Only start monitoring if Elasticsearch is started
if (!ElasticsearchProcessMonitor.isElasticsearchRunning()) {
String exceptionMsg = "Elasticsearch is not yet started, check back again later";
logger.info(exceptionMsg);
return;
}
NodeIndicesStatsBean nodeIndicesStatsBean = new NodeIndicesStatsBean();
try {
NodesStatsResponse nodesStatsResponse = ElasticsearchTransportClient.getNodesStatsResponse(config);
NodeStats nodeStats = null;
List<NodeStats> nodeStatsList = nodesStatsResponse.getNodes();
if (nodeStatsList.size() > 0) {
nodeStats = nodeStatsList.get(0);
}
if (nodeStats == null) {
logger.info("Node indices stats is not available (node stats is not available)");
return;
}
NodeIndicesStats nodeIndicesStats = nodeStats.getIndices();
if (nodeIndicesStats == null) {
logger.info("Node indices stats is not available");
return;
}
updateStoreDocs(nodeIndicesStatsBean, nodeIndicesStats);
updateRefreshFlush(nodeIndicesStatsBean, nodeIndicesStats);
updateMerge(nodeIndicesStatsBean, nodeIndicesStats);
updateCache(nodeIndicesStatsBean, nodeIndicesStats);
updateSearch(nodeIndicesStatsBean, nodeIndicesStats);
updateGet(nodeIndicesStatsBean, nodeIndicesStats);
updateIndexing(nodeIndicesStatsBean, nodeIndicesStats);
} catch (Exception e) {
logger.warn("Failed to load indices stats data", e);
}
nodeIndicesStatsReporter.nodeIndicesStatsBean.set(nodeIndicesStatsBean);
}
示例14: updateStoreDocs
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
private void updateStoreDocs(NodeIndicesStatsBean nodeIndicesStatsBean, NodeIndicesStats nodeIndicesStats) {
nodeIndicesStatsBean.storeSize = nodeIndicesStats.getStore().getSizeInBytes();
nodeIndicesStatsBean.storeThrottleTime = nodeIndicesStats.getStore().getThrottleTime().millis();
nodeIndicesStatsBean.docsCount = nodeIndicesStats.getDocs().getCount();
nodeIndicesStatsBean.docsDeleted = nodeIndicesStats.getDocs().getDeleted();
}
示例15: updateCache
import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
private void updateCache(NodeIndicesStatsBean nodeIndicesStatsBean, NodeIndicesStats nodeIndicesStats) {
nodeIndicesStatsBean.cacheFieldEvictions = nodeIndicesStats.getFieldData().getEvictions();
nodeIndicesStatsBean.cacheFieldSize = nodeIndicesStats.getFieldData().getMemorySizeInBytes();
}