当前位置: 首页>>代码示例>>Java>>正文


Java NodeIndicesStats类代码示例

本文整理汇总了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;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:23,代码来源:NodeStats.java

示例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);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:20,代码来源:NodeStats.java

示例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;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:19,代码来源:NodeStats.java

示例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());

}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:33,代码来源:NodeStats.java

示例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;
    }
}
 
开发者ID:Netflix,项目名称:Raigad,代码行数:14,代码来源:NodeIndicesStatsMonitor.java

示例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();
}
 
开发者ID:Netflix,项目名称:Raigad,代码行数:9,代码来源:NodeIndicesStatsMonitor.java

示例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;
		}
	}
}
 
开发者ID:swoop-inc,项目名称:elasticsearch-statsd-plugin,代码行数:30,代码来源:StatsdService.java

示例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;
}
 
开发者ID:swoop-inc,项目名称:elasticsearch-statsd-plugin,代码行数:10,代码来源:StatsdReporter.java

示例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;
}
 
开发者ID:spinscale,项目名称:elasticsearch-graphite-plugin,代码行数:14,代码来源:GraphiteReporter.java

示例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;
        }
    }
}
 
开发者ID:spinscale,项目名称:elasticsearch-graphite-plugin,代码行数:28,代码来源:GraphiteService.java

示例11: getIndices

import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
/**
 * Indices level stats.
 */
@Nullable
public NodeIndicesStats getIndices() {
    return this.indices;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:NodeStats.java

示例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);
        }
    }
}
 
开发者ID:jsuchenia,项目名称:elasticsearch-prometheus-metrics,代码行数:51,代码来源:IndicesMetricsGenerator.java

示例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);
}
 
开发者ID:Netflix,项目名称:Raigad,代码行数:46,代码来源:NodeIndicesStatsMonitor.java

示例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();
}
 
开发者ID:Netflix,项目名称:Raigad,代码行数:7,代码来源:NodeIndicesStatsMonitor.java

示例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();
}
 
开发者ID:Netflix,项目名称:Raigad,代码行数:5,代码来源:NodeIndicesStatsMonitor.java


注:本文中的org.elasticsearch.indices.NodeIndicesStats类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。