• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java NodeIndicesStats类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.elasticsearch.indices.NodeIndicesStats的典型用法代码示例。如果您正苦于以下问题:Java NodeIndicesStats类的具体用法?Java NodeIndicesStats怎么用?Java NodeIndicesStats使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NodeIndicesStats类属于org.elasticsearch.indices包,在下文中一共展示了NodeIndicesStats类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: updateSearch

import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
private void updateSearch(NodeIndicesStatsBean nodeIndicesStatsBean, NodeIndicesStats nodeIndicesStats) {
    nodeIndicesStatsBean.searchQueryTotal = nodeIndicesStats.getSearch().getTotal().getQueryCount();
    nodeIndicesStatsBean.searchFetchTotal = nodeIndicesStats.getSearch().getTotal().getFetchCount();
    nodeIndicesStatsBean.searchQueryCurrent = nodeIndicesStats.getSearch().getTotal().getQueryCurrent();

    long tmpSearchQueryDelta = nodeIndicesStatsBean.searchQueryTotal - cachedQueryCount;
    nodeIndicesStatsBean.searchQueryDelta = tmpSearchQueryDelta < 0 ? 0 : tmpSearchQueryDelta;
    long tmpSearchFetchDelta = nodeIndicesStatsBean.searchFetchTotal - cachedFetchCount;
    nodeIndicesStatsBean.searchFetchDelta = tmpSearchFetchDelta < 0 ? 0 : tmpSearchFetchDelta;

    nodeIndicesStatsBean.searchQueryTime = nodeIndicesStats.getSearch().getTotal().getQueryTimeInMillis();
    nodeIndicesStatsBean.searchFetchTime = nodeIndicesStats.getSearch().getTotal().getFetchTimeInMillis();

    long searchQueryDeltaTimeInMillis = (nodeIndicesStatsBean.searchQueryTime - cachedSearchQueryTime);
    if (nodeIndicesStatsBean.searchQueryDelta != 0) {
        recordSearchQueryLatencies(searchQueryDeltaTimeInMillis / nodeIndicesStatsBean.searchQueryDelta, TimeUnit.MILLISECONDS);
        nodeIndicesStatsBean.latencySearchQuery95 = latencySearchQuery95Histo.percentile(PERCENTILE_95);
        nodeIndicesStatsBean.latencySearchQuery99 = latencySearchQuery99Histo.percentile(PERCENTILE_99);
    } else {
        nodeIndicesStatsBean.latencySearchQuery95 = 0;
        nodeIndicesStatsBean.latencySearchQuery99 = 0;
    }

    if (nodeIndicesStatsBean.searchQueryTotal != 0) {
        nodeIndicesStatsBean.searchQueryAvgTimeInMillisPerRequest = nodeIndicesStatsBean.searchQueryTime / nodeIndicesStatsBean.searchQueryTotal;
    }

    long searchFetchDeltaTimeInMillis = (nodeIndicesStatsBean.searchFetchTime - cachedSearchFetchTime);
    if (nodeIndicesStatsBean.searchFetchDelta != 0) {
        recordSearchFetchLatencies(searchFetchDeltaTimeInMillis / nodeIndicesStatsBean.searchFetchDelta, TimeUnit.MILLISECONDS);
        nodeIndicesStatsBean.latencySearchFetch95 = latencySearchFetch95Histo.percentile(PERCENTILE_95);
        nodeIndicesStatsBean.latencySearchFetch99 = latencySearchFetch99Histo.percentile(PERCENTILE_99);
    } else {
        nodeIndicesStatsBean.latencySearchFetch95 = 0;
        nodeIndicesStatsBean.latencySearchFetch99 = 0;
    }

    if (nodeIndicesStatsBean.searchFetchTotal != 0) {
        nodeIndicesStatsBean.searchFetchAvgTimeInMillisPerRequest = nodeIndicesStatsBean.searchFetchTime / nodeIndicesStatsBean.searchFetchTotal;
    }

    nodeIndicesStatsBean.searchFetchCurrent = nodeIndicesStats.getSearch().getTotal().getFetchCurrent();

    cachedQueryCount += nodeIndicesStatsBean.searchQueryDelta;
    cachedFetchCount += nodeIndicesStatsBean.searchFetchDelta;
    cachedSearchQueryTime += searchQueryDeltaTimeInMillis;
    cachedSearchFetchTime += searchFetchDeltaTimeInMillis;
}
 
开发者ID:Netflix,项目名称:Raigad,代码行数:49,代码来源:NodeIndicesStatsMonitor.java


示例17: updateGet

import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
private void updateGet(NodeIndicesStatsBean nodeIndicesStatsBean, NodeIndicesStats nodeIndicesStats) {
    nodeIndicesStatsBean.getTotal = nodeIndicesStats.getGet().getCount();
    nodeIndicesStatsBean.getExistsTotal = nodeIndicesStats.getGet().getExistsCount();
    nodeIndicesStatsBean.getMissingTotal = nodeIndicesStats.getGet().getMissingCount();
    nodeIndicesStatsBean.getTime = nodeIndicesStats.getGet().getTimeInMillis();
    nodeIndicesStatsBean.getExistsTime = nodeIndicesStats.getGet().getExistsTimeInMillis();
    nodeIndicesStatsBean.getMissingTime = nodeIndicesStats.getGet().getMissingTimeInMillis();

    long tmpGetTotalDelta = nodeIndicesStatsBean.getTotal - cachedGetCount;
    nodeIndicesStatsBean.getTotalDelta = tmpGetTotalDelta < 0 ? 0 : tmpGetTotalDelta;
    long tmpGetExistsDelta = nodeIndicesStatsBean.getExistsTotal - cachedGetExistsCount;
    nodeIndicesStatsBean.getExistsDelta = tmpGetExistsDelta < 0 ? 0 : tmpGetExistsDelta;
    long tmpGetMissingDelta = nodeIndicesStatsBean.getMissingTotal - cachedGetMissingCount;
    nodeIndicesStatsBean.getMissingDelta = tmpGetMissingDelta < 0 ? 0 : tmpGetMissingDelta;

    long getDeltaTimeInMillis = (nodeIndicesStatsBean.getTime - cachedGetTime);
    if (nodeIndicesStatsBean.getTotalDelta != 0) {
        recordGetLatencies(getDeltaTimeInMillis / nodeIndicesStatsBean.getTotalDelta, TimeUnit.MILLISECONDS);
        nodeIndicesStatsBean.latencyGet95 = latencyGet95Histo.percentile(PERCENTILE_95);
        nodeIndicesStatsBean.latencyGet99 = latencyGet99Histo.percentile(PERCENTILE_99);
    } else {
        nodeIndicesStatsBean.latencyGet95 = 0;
        nodeIndicesStatsBean.latencyGet99 = 0;
    }

    if (nodeIndicesStatsBean.getTotal != 0)
        nodeIndicesStatsBean.getTotalAvgTimeInMillisPerRequest = nodeIndicesStatsBean.getTime / nodeIndicesStatsBean.getTotal;
    nodeIndicesStatsBean.getCurrent = nodeIndicesStats.getGet().current();

    long getExistsDeltaTimeInMillies = (nodeIndicesStatsBean.getExistsTime - cachedGetExistsTime);
    if (nodeIndicesStatsBean.getExistsDelta != 0) {
        recordGetExistsLatencies(getExistsDeltaTimeInMillies / nodeIndicesStatsBean.getExistsDelta, TimeUnit.MILLISECONDS);
        nodeIndicesStatsBean.latencyGetExists95 = latencyGetExists95Histo.percentile(PERCENTILE_95);
        nodeIndicesStatsBean.latencyGetExists99 = latencyGetExists99Histo.percentile(PERCENTILE_99);
    } else {
        nodeIndicesStatsBean.latencyGetExists95 = 0;
        nodeIndicesStatsBean.latencyGetExists99 = 0;
    }

    if (nodeIndicesStatsBean.getExistsTotal != 0)
        nodeIndicesStatsBean.getExistsAvgTimeInMillisPerRequest = nodeIndicesStatsBean.getExistsTime / nodeIndicesStatsBean.getExistsTotal;

    long getMissingDeltaTimeInMillies = (nodeIndicesStatsBean.getMissingTime - cachedGetMissingTime);
    if (nodeIndicesStatsBean.getMissingDelta != 0) {
        recordGetMissingLatencies(getMissingDeltaTimeInMillies / nodeIndicesStatsBean.getMissingDelta, TimeUnit.MILLISECONDS);
        nodeIndicesStatsBean.latencyGetMissing95 = latencyGetMissing95Histo.percentile(PERCENTILE_95);
        nodeIndicesStatsBean.latencyGetMissing99 = latencyGetMissing99Histo.percentile(PERCENTILE_99);
    } else {
        nodeIndicesStatsBean.latencyGetMissing95 = 0;
        nodeIndicesStatsBean.latencyGetMissing99 = 0;
    }

    if (nodeIndicesStatsBean.getMissingTotal != 0) {
        nodeIndicesStatsBean.getMissingAvgTimeInMillisPerRequest = nodeIndicesStatsBean.getMissingTime / nodeIndicesStatsBean.getMissingTotal;
    }

    cachedGetCount += nodeIndicesStatsBean.getTotalDelta;
    cachedGetExistsCount += nodeIndicesStatsBean.getExistsDelta;
    cachedGetMissingCount += nodeIndicesStatsBean.getMissingDelta;
    cachedGetTime += getDeltaTimeInMillis;
    cachedGetExistsTime += getExistsDeltaTimeInMillies;
    cachedGetMissingTime += getMissingDeltaTimeInMillies;
}
 
开发者ID:Netflix,项目名称:Raigad,代码行数:64,代码来源:NodeIndicesStatsMonitor.java


示例18: updateIndexing

import org.elasticsearch.indices.NodeIndicesStats; //导入依赖的package包/类
private void updateIndexing(NodeIndicesStatsBean nodeIndicesStatsBean, NodeIndicesStats nodeIndicesStats) {
    nodeIndicesStatsBean.indexingIndexTotal = nodeIndicesStats.getIndexing().getTotal().getIndexCount();
    nodeIndicesStatsBean.indexingDeleteTotal = nodeIndicesStats.getIndexing().getTotal().getDeleteCount();
    nodeIndicesStatsBean.indexingIndexCurrent = nodeIndicesStats.getIndexing().getTotal().getIndexCurrent();

    long tmpIndexingIndexDelta = (nodeIndicesStatsBean.indexingIndexTotal - cachedIndexingIndexTotal);
    nodeIndicesStatsBean.indexingIndexDelta = tmpIndexingIndexDelta < 0 ? 0 : tmpIndexingIndexDelta;
    long tmpIndexingDeleteDelta = (nodeIndicesStatsBean.indexingDeleteTotal - cachedIndexingDeleteTotal);
    nodeIndicesStatsBean.indexingDeleteDelta = tmpIndexingDeleteDelta < 0 ? 0 : tmpIndexingDeleteDelta;

    nodeIndicesStatsBean.indexingIndexTimeInMillis = nodeIndicesStats.getIndexing().getTotal().getIndexTime().getMillis();
    nodeIndicesStatsBean.indexingDeleteTime = nodeIndicesStats.getIndexing().getTotal().getDeleteTime().getMillis();

    long indexingTimeInMillis = (nodeIndicesStatsBean.indexingIndexTimeInMillis - cachedIndexingTime);
    if (nodeIndicesStatsBean.indexingIndexDelta != 0) {
        recordIndexingLatencies(indexingTimeInMillis / nodeIndicesStatsBean.indexingIndexDelta, TimeUnit.MILLISECONDS);
        nodeIndicesStatsBean.latencyIndexing95 = latencyIndexing95Histo.percentile(PERCENTILE_95);
        nodeIndicesStatsBean.latencyIndexing99 = latencyIndexing99Histo.percentile(PERCENTILE_99);
    } else {
        nodeIndicesStatsBean.latencyIndexing95 = 0;
        nodeIndicesStatsBean.latencyIndexing99 = 0;
    }

    if (nodeIndicesStatsBean.indexingIndexTotal != 0) {
        nodeIndicesStatsBean.indexingAvgTimeInMillisPerRequest = nodeIndicesStatsBean.indexingIndexTimeInMillis / nodeIndicesStatsBean.indexingIndexTotal;
    }

    long indexDeleteTimeInMillis = (nodeIndicesStatsBean.indexingDeleteTime - cachedIndexDeleteTime);
    if (nodeIndicesStatsBean.indexingDeleteDelta != 0) {
        recordIndexDeleteLatencies(indexDeleteTimeInMillis / nodeIndicesStatsBean.indexingDeleteDelta, TimeUnit.MILLISECONDS);
        nodeIndicesStatsBean.latencyIndexDelete95 = latencyIndexDelete95Histo.percentile(PERCENTILE_95);
        nodeIndicesStatsBean.latencyIndexDelete99 = latencyIndexDelete99Histo.percentile(PERCENTILE_99);
    } else {
        nodeIndicesStatsBean.latencyIndexDelete95 = 0;
        nodeIndicesStatsBean.latencyIndexDelete99 = 0;
    }

    if (nodeIndicesStatsBean.indexingDeleteTotal != 0) {
        nodeIndicesStatsBean.indexingDeleteAvgTimeInMillisPerRequest = nodeIndicesStatsBean.indexingDeleteTime / nodeIndicesStatsBean.indexingDeleteTotal;
    }

    nodeIndicesStatsBean.indexingDeleteCurrent = nodeIndicesStats.getIndexing().getTotal().getDeleteCurrent();

    cachedIndexingIndexTotal += nodeIndicesStatsBean.indexingIndexDelta;
    cachedIndexingDeleteTotal += nodeIndicesStatsBean.indexingDeleteDelta;
    cachedIndexingTime += indexingTimeInMillis;
    cachedIndexDeleteTime += indexDeleteTimeInMillis;
}
 
开发者ID:Netflix,项目名称:Raigad,代码行数:49,代码来源:NodeIndicesStatsMonitor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RasterFactory类代码示例发布时间:2022-05-22
下一篇:
Java GraphPath类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap