org.elasticsearch.indices.IndicesService.stats()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(153)

本文整理了Java中org.elasticsearch.indices.IndicesService.stats()方法的一些代码示例,展示了IndicesService.stats()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IndicesService.stats()方法的具体详情如下:
包路径:org.elasticsearch.indices.IndicesService
类名称:IndicesService
方法名:stats

IndicesService.stats介绍

[英]Returns the node stats indices stats. The includePrevious flag controls if old shards stats will be aggregated as well (only for relevant stats, such as refresh and indexing, not for docs/store).
[中]返回节点统计信息索引统计信息。includePrevious标志控制是否也将聚合旧碎片统计信息(仅用于相关统计信息,如刷新和索引,不用于文档/存储)。

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Returns the node stats indices stats. The {@code includePrevious} flag controls
 * if old shards stats will be aggregated as well (only for relevant stats, such as
 * refresh and indexing, not for docs/store).
 */
public NodeIndicesStats stats(boolean includePrevious) {
  return stats(includePrevious, new CommonStatsFlags().all());
}

代码示例来源:origin: apache/servicemix-bundles

return stats(includePrevious, new CommonStatsFlags().all());

代码示例来源:origin: org.elasticsearch/elasticsearch

public NodeStats stats(CommonStatsFlags indices, boolean os, boolean process, boolean jvm, boolean threadPool,
            boolean fs, boolean transport, boolean http, boolean circuitBreaker,
            boolean script, boolean discoveryStats, boolean ingest, boolean adaptiveSelection) {
  // for indices stats we want to include previous allocated shards stats as well (it will
  // only be applied to the sensible ones to use, like refresh/merge/flush/indexing stats)
  return new NodeStats(transportService.getLocalNode(), System.currentTimeMillis(),
      indices.anySet() ? indicesService.stats(true, indices) : null,
      os ? monitorService.osService().stats() : null,
      process ? monitorService.processService().stats() : null,
      jvm ? monitorService.jvmService().stats() : null,
      threadPool ? this.threadPool.stats() : null,
      fs ? monitorService.fsService().stats() : null,
      transport ? transportService.stats() : null,
      http ? (httpServerTransport == null ? null : httpServerTransport.stats()) : null,
      circuitBreaker ? circuitBreakerService.stats() : null,
      script ? scriptService.stats() : null,
      discoveryStats ? discovery.stats() : null,
      ingest ? ingestService.stats() : null,
      adaptiveSelection ? responseCollectorService.getAdaptiveStats(searchTransportService.getPendingSearchRequests()) : null
  );
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

/**
 * Returns the node stats indices stats. The <tt>includePrevious</tt> flag controls
 * if old shards stats will be aggregated as well (only for relevant stats, such as
 * refresh and indexing, not for docs/store).
 */
public NodeIndicesStats stats(boolean includePrevious) {
  return stats(includePrevious, new CommonStatsFlags().all());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * Returns the node stats indices stats. The {@code includePrevious} flag controls
 * if old shards stats will be aggregated as well (only for relevant stats, such as
 * refresh and indexing, not for docs/store).
 */
public NodeIndicesStats stats(boolean includePrevious) {
  return stats(includePrevious, new CommonStatsFlags().all());
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Returns the node stats indices stats. The <tt>includePrevious</tt> flag controls
 * if old shards stats will be aggregated as well (only for relevant stats, such as
 * refresh and indexing, not for docs/store).
 */
public NodeIndicesStats stats(boolean includePrevious) {
  return stats(includePrevious, new CommonStatsFlags().all());
}

代码示例来源:origin: harbby/presto-connectors

public NodeStats stats() throws IOException {
  // for indices stats we want to include previous allocated shards stats as well (it will
  // only be applied to the sensible ones to use, like refresh/merge/flush/indexing stats)
  return new NodeStats(discovery.localNode(), System.currentTimeMillis(),
      indicesService.stats(true),
      monitorService.osService().stats(),
      monitorService.processService().stats(),
      monitorService.jvmService().stats(),
      threadPool.stats(),
      monitorService.fsService().stats(),
      transportService.stats(),
      httpServer == null ? null : httpServer.stats(),
      circuitBreakerService.stats(),
      scriptService.stats()
  );
}

代码示例来源:origin: harbby/presto-connectors

public NodeStats stats(CommonStatsFlags indices, boolean os, boolean process, boolean jvm, boolean threadPool,
              boolean fs, boolean transport, boolean http, boolean circuitBreaker,
              boolean script) {
    // for indices stats we want to include previous allocated shards stats as well (it will
    // only be applied to the sensible ones to use, like refresh/merge/flush/indexing stats)
    return new NodeStats(discovery.localNode(), System.currentTimeMillis(),
        indices.anySet() ? indicesService.stats(true, indices) : null,
        os ? monitorService.osService().stats() : null,
        process ? monitorService.processService().stats() : null,
        jvm ? monitorService.jvmService().stats() : null,
        threadPool ? this.threadPool.stats() : null,
        fs ? monitorService.fsService().stats() : null,
        transport ? transportService.stats() : null,
        http ? (httpServer == null ? null : httpServer.stats()) : null,
        circuitBreaker ? circuitBreakerService.stats() : null,
        script ? scriptService.stats() : null
    );
  }
}

代码示例来源:origin: spinscale/elasticsearch-graphite-plugin

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;
    }
  }
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

public NodeStats stats(CommonStatsFlags indices, boolean os, boolean process, boolean jvm, boolean threadPool,
            boolean fs, boolean transport, boolean http, boolean circuitBreaker,
            boolean script, boolean discoveryStats, boolean ingest) {
  // for indices stats we want to include previous allocated shards stats as well (it will
  // only be applied to the sensible ones to use, like refresh/merge/flush/indexing stats)
  return new NodeStats(discovery.localNode(), System.currentTimeMillis(),
      indices.anySet() ? indicesService.stats(true, indices) : null,
      os ? monitorService.osService().stats() : null,
      process ? monitorService.processService().stats() : null,
      jvm ? monitorService.jvmService().stats() : null,
      threadPool ? this.threadPool.stats() : null,
      fs ? monitorService.fsService().stats() : null,
      transport ? transportService.stats() : null,
      http ? (httpServerTransport == null ? null : httpServerTransport.stats()) : null,
      circuitBreaker ? circuitBreakerService.stats() : null,
      script ? scriptService.stats() : null,
      discoveryStats ? discovery.stats() : null,
      ingest ? ingestService.getPipelineExecutionService().stats() : null
  );
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

public NodeStats stats(CommonStatsFlags indices, boolean os, boolean process, boolean jvm, boolean threadPool,
            boolean fs, boolean transport, boolean http, boolean circuitBreaker,
            boolean script, boolean discoveryStats, boolean ingest, boolean adaptiveSelection) {
  // for indices stats we want to include previous allocated shards stats as well (it will
  // only be applied to the sensible ones to use, like refresh/merge/flush/indexing stats)
  return new NodeStats(transportService.getLocalNode(), System.currentTimeMillis(),
      indices.anySet() ? indicesService.stats(true, indices) : null,
      os ? monitorService.osService().stats() : null,
      process ? monitorService.processService().stats() : null,
      jvm ? monitorService.jvmService().stats() : null,
      threadPool ? this.threadPool.stats() : null,
      fs ? monitorService.fsService().stats() : null,
      transport ? transportService.stats() : null,
      http ? (httpServerTransport == null ? null : httpServerTransport.stats()) : null,
      circuitBreaker ? circuitBreakerService.stats() : null,
      script ? scriptService.stats() : null,
      discoveryStats ? discovery.stats() : null,
      ingest ? ingestService.stats() : null,
      adaptiveSelection ? responseCollectorService.getAdaptiveStats(searchTransportService.getPendingSearchRequests()) : null
  );
}

相关文章

微信公众号

最新文章

更多